请阅读如何使用过滤器和操作(我这里不再重复)
主题或插件中的过滤器
// inside /wp-includes/taxonomy.php on line 1586
$value = apply_filters("edit_{$taxonomy}_{$field}", $value, $term_id);
// inside some theme file that runs before - best on functions.php during your themes bootstrap:
function wpse40709_edit_tax_field( $value, $term_id )
{
// Do modifications
return $value;
}
// Should be hooked in bootstrap, so best would be \'after_setup_theme\' until \'admin_init\'
add_filter( \'edit_YOUR-TAXONOMY-NAME_YOUR-FIELD-NAME\', \'wpse40709_edit_tax_field\', 20, 2 );
当
sanitize_term_field($field, $value, $term_id, $taxonomy, $context)
跑步。所以
$field
是你所在领域的名称。