pre_(taxonomy)_(field) хук-фильтрWP 2.3.0

Filters a taxonomy field before it is sanitized.

The dynamic portions of the filter name, $taxonomy and $field, refer to the taxonomy slug and field name, respectively.

Использование

add_filter( 'pre_(taxonomy)_(field)', 'wp_kama_pre_taxonomy_field_filter' );

/**
 * Function for `pre_(taxonomy)_(field)` filter-hook.
 * 
 * @param mixed $value Value of the taxonomy field.
 *
 * @return mixed
 */
function wp_kama_pre_taxonomy_field_filter( $value ){

	// filter...
	return $value;
}
$value(разное)
Value of the taxonomy field.

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

sanitize_term_field()
pre_(taxonomy)_(field)
wp-includes/taxonomy.php 1763
$value = apply_filters( "pre_{$taxonomy}_{$field}", $value );

Где используется хук в WordPress

wp-admin/includes/ajax-actions.php 1327
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-admin/includes/ajax-actions.php 1326
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-admin/includes/bookmark.php 339
add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
wp-admin/includes/bookmark.php 341
remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
wp-admin/options-discussion.php 299
add_filter( 'pre_option_show_avatars', '__return_true', 100 );
wp-admin/options-discussion.php 309
remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
wp-includes/block-supports/elements.php 127
add_filter( 'pre_render_block', 'wp_render_elements_support_styles', 10, 2 );
wp-includes/block-template.php 30
add_filter( 'pre_get_posts', '_resolve_template_for_new_post' );
wp-includes/block-template.php 319
remove_filter( 'pre_get_posts', '_resolve_template_for_new_post' );
wp-includes/blocks/site-logo.php 136
add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
wp-includes/class-wp-customize-manager.php 717
remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
wp-includes/class-wp-customize-manager.php 724
remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
wp-includes/class-wp-customize-manager.php 721
remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 720
remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
wp-includes/class-wp-customize-manager.php 679
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
wp-includes/class-wp-customize-manager.php 687
add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
wp-includes/class-wp-customize-manager.php 686
add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
wp-includes/class-wp-customize-manager.php 683
add_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 682
add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
wp-includes/class-wp-customize-manager.php 725
remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
wp-includes/class-wp-customize-setting.php 379
add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
wp-includes/class-wp-customize-widgets.php 2097
add_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 );
wp-includes/class-wp-customize-widgets.php 2155
remove_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10 );
wp-includes/class-wp-customize-widgets.php 2158
remove_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) );
wp-includes/class-wp-customize-widgets.php 2116
add_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) );
wp-includes/comment.php 2508
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 2522
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 3590
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/comment.php 3591
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/default-filters.php 675
add_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10, 3 );
wp-includes/default-filters.php 91
add_filter( 'pre_term_slug', 'sanitize_title' );
wp-includes/default-filters.php 684
add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
wp-includes/default-filters.php 460
add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' );
wp-includes/default-filters.php 466
add_filter( 'pre_option_embed_autourls', '__return_true' );
wp-includes/default-filters.php 292
add_filter( 'pre_comment_content', 'wp_rel_ugc', 15 );
wp-includes/default-filters.php 100
add_filter( 'pre_post_mime_type', 'sanitize_mime_type' );
wp-includes/kses.php 2156
add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2158
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/kses.php 2188
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2189
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/sitemaps/class-wp-sitemaps.php 78
add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );