Changeset 42343 for trunk/src/wp-includes/default-filters.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/default-filters.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r42201 r42343 15 15 // Strip, trim, kses, special chars for string saves 16 16 foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { 17 add_filter( $filter, 'sanitize_text_field' );18 add_filter( $filter, 'wp_filter_kses' );17 add_filter( $filter, 'sanitize_text_field' ); 18 add_filter( $filter, 'wp_filter_kses' ); 19 19 add_filter( $filter, '_wp_specialchars', 30 ); 20 20 } … … 24 24 if ( is_admin() ) { 25 25 // These are expensive. Run only on admin pages for defense in depth. 26 add_filter( $filter, 'sanitize_text_field' );27 add_filter( $filter, 'wp_kses_data' );26 add_filter( $filter, 'sanitize_text_field' ); 27 add_filter( $filter, 'wp_kses_data' ); 28 28 } 29 29 add_filter( $filter, '_wp_specialchars', 30 ); … … 45 45 // Email saves 46 46 foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) { 47 add_filter( $filter, 'trim' );47 add_filter( $filter, 'trim' ); 48 48 add_filter( $filter, 'sanitize_email' ); 49 49 add_filter( $filter, 'wp_filter_kses' ); … … 53 53 foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { 54 54 add_filter( $filter, 'sanitize_email' ); 55 if ( is_admin() ) 55 if ( is_admin() ) { 56 56 add_filter( $filter, 'wp_kses_data' ); 57 } 57 58 } 58 59 59 60 // Save URL 60 foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', 61 'pre_link_rss', 'pre_post_guid' ) as $filter ) { 61 foreach ( array( 62 'pre_comment_author_url', 63 'pre_user_url', 64 'pre_link_url', 65 'pre_link_image', 66 'pre_link_rss', 67 'pre_post_guid', 68 ) as $filter ) { 62 69 add_filter( $filter, 'wp_strip_all_tags' ); 63 add_filter( $filter, 'esc_url_raw' );64 add_filter( $filter, 'wp_filter_kses' );70 add_filter( $filter, 'esc_url_raw' ); 71 add_filter( $filter, 'wp_filter_kses' ); 65 72 } 66 73 67 74 // Display URL 68 75 foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) { 69 if ( is_admin() ) 76 if ( is_admin() ) { 70 77 add_filter( $filter, 'wp_strip_all_tags' ); 71 add_filter( $filter, 'esc_url' ); 72 if ( is_admin() ) 73 add_filter( $filter, 'wp_kses_data' ); 78 } 79 add_filter( $filter, 'esc_url' ); 80 if ( is_admin() ) { 81 add_filter( $filter, 'wp_kses_data' ); 82 } 74 83 } 75 84 … … 98 107 // Format strings for display. 99 108 foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) { 100 add_filter( $filter, 'wptexturize' );109 add_filter( $filter, 'wptexturize' ); 101 110 add_filter( $filter, 'convert_chars' ); 102 add_filter( $filter, 'esc_html' );111 add_filter( $filter, 'esc_html' ); 103 112 } 104 113 105 114 // Format WordPress 106 foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) 115 foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) { 107 116 add_filter( $filter, 'capital_P_dangit', 11 ); 117 } 108 118 add_filter( 'comment_text', 'capital_P_dangit', 31 ); 109 119 … … 111 121 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { 112 122 add_filter( $filter, 'wptexturize' ); 113 add_filter( $filter, 'strip_tags' );123 add_filter( $filter, 'strip_tags' ); 114 124 } 115 125 116 126 // Format text area for display. 117 127 foreach ( array( 'term_description', 'get_the_author_description', 'get_the_post_type_description' ) as $filter ) { 118 add_filter( $filter, 'wptexturize' );119 add_filter( $filter, 'convert_chars' );120 add_filter( $filter, 'wpautop' );121 add_filter( $filter, 'shortcode_unautop' );128 add_filter( $filter, 'wptexturize' ); 129 add_filter( $filter, 'convert_chars' ); 130 add_filter( $filter, 'wpautop' ); 131 add_filter( $filter, 'shortcode_unautop' ); 122 132 } 123 133 … … 130 140 131 141 // Display filters 132 add_filter( 'the_title', 'wptexturize' );142 add_filter( 'the_title', 'wptexturize' ); 133 143 add_filter( 'the_title', 'convert_chars' ); 134 add_filter( 'the_title', 'trim' );135 136 add_filter( 'the_content', 'wptexturize' );137 add_filter( 'the_content', 'convert_smilies', 20 );138 add_filter( 'the_content', 'wpautop' );139 add_filter( 'the_content', 'shortcode_unautop' );140 add_filter( 'the_content', 'prepend_attachment' );144 add_filter( 'the_title', 'trim' ); 145 146 add_filter( 'the_content', 'wptexturize' ); 147 add_filter( 'the_content', 'convert_smilies', 20 ); 148 add_filter( 'the_content', 'wpautop' ); 149 add_filter( 'the_content', 'shortcode_unautop' ); 150 add_filter( 'the_content', 'prepend_attachment' ); 141 151 add_filter( 'the_content', 'wp_make_content_images_responsive' ); 142 152 143 add_filter( 'the_excerpt', 'wptexturize');144 add_filter( 'the_excerpt', 'convert_smilies');145 add_filter( 'the_excerpt', 'convert_chars');146 add_filter( 'the_excerpt', 'wpautop');147 add_filter( 'the_excerpt', 'shortcode_unautop');148 add_filter( 'get_the_excerpt', 'wp_trim_excerpt' );149 150 add_filter( 'the_post_thumbnail_caption', 'wptexturize' );153 add_filter( 'the_excerpt', 'wptexturize' ); 154 add_filter( 'the_excerpt', 'convert_smilies' ); 155 add_filter( 'the_excerpt', 'convert_chars' ); 156 add_filter( 'the_excerpt', 'wpautop' ); 157 add_filter( 'the_excerpt', 'shortcode_unautop' ); 158 add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); 159 160 add_filter( 'the_post_thumbnail_caption', 'wptexturize' ); 151 161 add_filter( 'the_post_thumbnail_caption', 'convert_smilies' ); 152 add_filter( 'the_post_thumbnail_caption', 'convert_chars' );153 154 add_filter( 'comment_text', 'wptexturize' );155 add_filter( 'comment_text', 'convert_chars' );156 add_filter( 'comment_text', 'make_clickable', 9 );162 add_filter( 'the_post_thumbnail_caption', 'convert_chars' ); 163 164 add_filter( 'comment_text', 'wptexturize' ); 165 add_filter( 'comment_text', 'convert_chars' ); 166 add_filter( 'comment_text', 'make_clickable', 9 ); 157 167 add_filter( 'comment_text', 'force_balance_tags', 25 ); 158 add_filter( 'comment_text', 'convert_smilies', 20 );159 add_filter( 'comment_text', 'wpautop', 30 );168 add_filter( 'comment_text', 'convert_smilies', 20 ); 169 add_filter( 'comment_text', 'wpautop', 30 ); 160 170 161 171 add_filter( 'comment_excerpt', 'convert_chars' ); 162 172 163 add_filter( 'list_cats', 'wptexturize' );173 add_filter( 'list_cats', 'wptexturize' ); 164 174 165 175 add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 ); 166 176 167 add_filter( 'widget_text', 'balanceTags');177 add_filter( 'widget_text', 'balanceTags' ); 168 178 add_filter( 'widget_text_content', 'capital_P_dangit', 11 ); 169 add_filter( 'widget_text_content', 'wptexturize' );170 add_filter( 'widget_text_content', 'convert_smilies', 20 );171 add_filter( 'widget_text_content', 'wpautop' );172 add_filter( 'widget_text_content', 'shortcode_unautop' );173 add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run.179 add_filter( 'widget_text_content', 'wptexturize' ); 180 add_filter( 'widget_text_content', 'convert_smilies', 20 ); 181 add_filter( 'widget_text_content', 'wpautop' ); 182 add_filter( 'widget_text_content', 'shortcode_unautop' ); 183 add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run. 174 184 175 185 add_filter( 'date_i18n', 'wp_maybe_decline_date' ); 176 186 177 187 // RSS filters 178 add_filter( 'the_title_rss', 'strip_tags');179 add_filter( 'the_title_rss', 'ent2ncr',8 );180 add_filter( 'the_title_rss', 'esc_html');181 add_filter( 'the_content_rss', 'ent2ncr',8 );182 add_filter( 'the_content_feed', 'wp_staticize_emoji');183 add_filter( 'the_content_feed', '_oembed_filter_feed_content');184 add_filter( 'the_excerpt_rss', 'convert_chars');185 add_filter( 'the_excerpt_rss', 'ent2ncr',8 );186 add_filter( 'comment_author_rss', 'ent2ncr', 8 );187 add_filter( 'comment_text_rss', 'ent2ncr',8 );188 add_filter( 'comment_text_rss', 'esc_html');189 add_filter( 'comment_text_rss', 'wp_staticize_emoji');190 add_filter( 'bloginfo_rss', 'ent2ncr',8 );191 add_filter( 'the_author', 'ent2ncr',8 );192 add_filter( 'the_guid', 'esc_url');188 add_filter( 'the_title_rss', 'strip_tags' ); 189 add_filter( 'the_title_rss', 'ent2ncr', 8 ); 190 add_filter( 'the_title_rss', 'esc_html' ); 191 add_filter( 'the_content_rss', 'ent2ncr', 8 ); 192 add_filter( 'the_content_feed', 'wp_staticize_emoji' ); 193 add_filter( 'the_content_feed', '_oembed_filter_feed_content' ); 194 add_filter( 'the_excerpt_rss', 'convert_chars' ); 195 add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); 196 add_filter( 'comment_author_rss', 'ent2ncr', 8 ); 197 add_filter( 'comment_text_rss', 'ent2ncr', 8 ); 198 add_filter( 'comment_text_rss', 'esc_html' ); 199 add_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 200 add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); 201 add_filter( 'the_author', 'ent2ncr', 8 ); 202 add_filter( 'the_guid', 'esc_url' ); 193 203 194 204 // Email filters … … 201 211 202 212 // Misc filters 203 add_filter( 'option_ping_sites', 'privacy_ping_filter');204 add_filter( 'option_blog_charset', '_wp_specialchars'); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop205 add_filter( 'option_blog_charset', '_canonical_charset');206 add_filter( 'option_home', '_config_wp_home');207 add_filter( 'option_siteurl', '_config_wp_siteurl');208 add_filter( 'tiny_mce_before_init', '_mce_set_direction');209 add_filter( 'teeny_mce_before_init', '_mce_set_direction');210 add_filter( 'pre_kses', 'wp_pre_kses_less_than');211 add_filter( 'sanitize_title', 'sanitize_title_with_dashes',10, 3 );212 add_action( 'check_comment_flood', 'check_comment_flood_db',10, 4 );213 add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood',10, 3 );214 add_filter( 'pre_comment_content', 'wp_rel_nofollow', 15);215 add_filter( 'comment_email', 'antispambot');216 add_filter( 'option_tag_base', '_wp_filter_taxonomy_base');217 add_filter( 'option_category_base', '_wp_filter_taxonomy_base');218 add_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2);219 add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 );220 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 );221 add_filter( 'editable_slug', 'urldecode');222 add_filter( 'editable_slug', 'esc_textarea');223 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );224 add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' );225 add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error');226 add_filter( 'title_save_pre', 'trim');213 add_filter( 'option_ping_sites', 'privacy_ping_filter' ); 214 add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop 215 add_filter( 'option_blog_charset', '_canonical_charset' ); 216 add_filter( 'option_home', '_config_wp_home' ); 217 add_filter( 'option_siteurl', '_config_wp_siteurl' ); 218 add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); 219 add_filter( 'teeny_mce_before_init', '_mce_set_direction' ); 220 add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); 221 add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); 222 add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); 223 add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 ); 224 add_filter( 'pre_comment_content', 'wp_rel_nofollow', 15 ); 225 add_filter( 'comment_email', 'antispambot' ); 226 add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' ); 227 add_filter( 'option_category_base', '_wp_filter_taxonomy_base' ); 228 add_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2 ); 229 add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); 230 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); 231 add_filter( 'editable_slug', 'urldecode' ); 232 add_filter( 'editable_slug', 'esc_textarea' ); 233 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 234 add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' ); 235 add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' ); 236 add_filter( 'title_save_pre', 'trim' ); 227 237 228 238 add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 ); 229 239 230 add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );240 add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 ); 231 241 232 242 // REST API filters. 233 add_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );234 add_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 );235 add_action( 'template_redirect', 'rest_output_link_header', 11, 0 );236 add_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' );237 add_action( 'auth_cookie_expired', 'rest_cookie_collect_status' );238 add_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' );239 add_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' );240 add_action( 'auth_cookie_valid', 'rest_cookie_collect_status' );243 add_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' ); 244 add_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 ); 245 add_action( 'template_redirect', 'rest_output_link_header', 11, 0 ); 246 add_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' ); 247 add_action( 'auth_cookie_expired', 'rest_cookie_collect_status' ); 248 add_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' ); 249 add_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' ); 250 add_action( 'auth_cookie_valid', 'rest_cookie_collect_status' ); 241 251 add_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 ); 242 252 243 253 // Actions 244 add_action( 'wp_head', '_wp_render_title_tag', 1 ); 245 add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); 246 add_action( 'wp_head', 'wp_resource_hints', 2 ); 247 add_action( 'wp_head', 'feed_links', 2 ); 248 add_action( 'wp_head', 'feed_links_extra', 3 ); 249 add_action( 'wp_head', 'rsd_link' ); 250 add_action( 'wp_head', 'wlwmanifest_link' ); 251 add_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); 252 add_action( 'wp_head', 'locale_stylesheet' ); 253 add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); 254 add_action( 'wp_head', 'noindex', 1 ); 255 add_action( 'wp_head', 'print_emoji_detection_script', 7 ); 256 add_action( 'wp_head', 'wp_print_styles', 8 ); 257 add_action( 'wp_head', 'wp_print_head_scripts', 9 ); 258 add_action( 'wp_head', 'wp_generator' ); 259 add_action( 'wp_head', 'rel_canonical' ); 260 add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); 261 add_action( 'wp_head', 'wp_custom_css_cb', 101 ); 262 add_action( 'wp_head', 'wp_site_icon', 99 ); 263 add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); 264 add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); 265 add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); 266 add_action( 'init', 'check_theme_switched', 99 ); 267 add_action( 'after_switch_theme', '_wp_menus_changed' ); 268 add_action( 'after_switch_theme', '_wp_sidebars_changed' ); 269 add_action( 'wp_print_styles', 'print_emoji_styles' ); 270 271 if ( isset( $_GET['replytocom'] ) ) 272 add_action( 'wp_head', 'wp_no_robots' ); 254 add_action( 'wp_head', '_wp_render_title_tag', 1 ); 255 add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); 256 add_action( 'wp_head', 'wp_resource_hints', 2 ); 257 add_action( 'wp_head', 'feed_links', 2 ); 258 add_action( 'wp_head', 'feed_links_extra', 3 ); 259 add_action( 'wp_head', 'rsd_link' ); 260 add_action( 'wp_head', 'wlwmanifest_link' ); 261 add_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); 262 add_action( 'wp_head', 'locale_stylesheet' ); 263 add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); 264 add_action( 'wp_head', 'noindex', 1 ); 265 add_action( 'wp_head', 'print_emoji_detection_script', 7 ); 266 add_action( 'wp_head', 'wp_print_styles', 8 ); 267 add_action( 'wp_head', 'wp_print_head_scripts', 9 ); 268 add_action( 'wp_head', 'wp_generator' ); 269 add_action( 'wp_head', 'rel_canonical' ); 270 add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); 271 add_action( 'wp_head', 'wp_custom_css_cb', 101 ); 272 add_action( 'wp_head', 'wp_site_icon', 99 ); 273 add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); 274 add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); 275 add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); 276 add_action( 'init', 'check_theme_switched', 99 ); 277 add_action( 'after_switch_theme', '_wp_menus_changed' ); 278 add_action( 'after_switch_theme', '_wp_sidebars_changed' ); 279 add_action( 'wp_print_styles', 'print_emoji_styles' ); 280 281 if ( isset( $_GET['replytocom'] ) ) { 282 add_action( 'wp_head', 'wp_no_robots' ); 283 } 273 284 274 285 // Login actions 275 add_filter( 'login_head', 'wp_resource_hints', 8);276 add_action( 'login_head', 'wp_print_head_scripts', 9);277 add_action( 'login_head', 'print_admin_styles', 9);278 add_action( 'login_head', 'wp_site_icon', 99);279 add_action( 'login_footer', 'wp_print_footer_scripts', 20);280 add_action( 'login_init', 'send_frame_options_header',10, 0 );286 add_filter( 'login_head', 'wp_resource_hints', 8 ); 287 add_action( 'login_head', 'wp_print_head_scripts', 9 ); 288 add_action( 'login_head', 'print_admin_styles', 9 ); 289 add_action( 'login_head', 'wp_site_icon', 99 ); 290 add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); 291 add_action( 'login_init', 'send_frame_options_header', 10, 0 ); 281 292 282 293 // Feed Generator Tags … … 291 302 292 303 // WP Cron 293 if ( ! defined( 'DOING_CRON' ) )304 if ( ! defined( 'DOING_CRON' ) ) { 294 305 add_action( 'init', 'wp_cron' ); 306 } 295 307 296 308 // 2 Actions 2 Furious 297 add_action( 'do_feed_rdf', 'do_feed_rdf',10, 1 );298 add_action( 'do_feed_rss', 'do_feed_rss',10, 1 );299 add_action( 'do_feed_rss2', 'do_feed_rss2',10, 1 );300 add_action( 'do_feed_atom', 'do_feed_atom',10, 1 );301 add_action( 'do_pings', 'do_all_pings',10, 1 );302 add_action( 'do_robots', 'do_robots');303 add_action( 'set_comment_cookies', 'wp_set_comment_cookies',10, 2 );304 add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies');305 add_action( 'admin_print_scripts', 'print_emoji_detection_script');306 add_action( 'admin_print_scripts', 'print_head_scripts', 20);307 add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );308 add_action( 'admin_print_styles', 'print_emoji_styles');309 add_action( 'admin_print_styles', 'print_admin_styles', 20);310 add_action( 'init', 'smilies_init', 5);311 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0);312 add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0);313 add_action( 'shutdown', 'wp_ob_end_flush_all', 1);309 add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); 310 add_action( 'do_feed_rss', 'do_feed_rss', 10, 1 ); 311 add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); 312 add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); 313 add_action( 'do_pings', 'do_all_pings', 10, 1 ); 314 add_action( 'do_robots', 'do_robots' ); 315 add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 2 ); 316 add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); 317 add_action( 'admin_print_scripts', 'print_emoji_detection_script' ); 318 add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); 319 add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' ); 320 add_action( 'admin_print_styles', 'print_emoji_styles' ); 321 add_action( 'admin_print_styles', 'print_admin_styles', 20 ); 322 add_action( 'init', 'smilies_init', 5 ); 323 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); 324 add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); 325 add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); 314 326 // Create a revision whenever a post is updated. 315 add_action( 'post_updated', 'wp_save_post_revision',10, 1 );316 add_action( 'publish_post', '_publish_post_hook',5, 1 );317 add_action( 'transition_post_status', '_transition_post_status',5, 3 );318 add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 );319 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce');320 add_action( 'admin_init', 'send_frame_options_header',10, 0 );321 add_action( 'welcome_panel', 'wp_welcome_panel');327 add_action( 'post_updated', 'wp_save_post_revision', 10, 1 ); 328 add_action( 'publish_post', '_publish_post_hook', 5, 1 ); 329 add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); 330 add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); 331 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); 332 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 333 add_action( 'welcome_panel', 'wp_welcome_panel' ); 322 334 323 335 // Cron tasks 324 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete');325 add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' );326 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment');327 add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment');328 add_action( 'delete_expired_transients', 'delete_expired_transients' );336 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); 337 add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' ); 338 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); 339 add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); 340 add_action( 'delete_expired_transients', 'delete_expired_transients' ); 329 341 330 342 // Navigation menu actions 331 add_action( 'delete_post', '_wp_delete_post_menu_item');332 add_action( 'delete_term', '_wp_delete_tax_menu_item',10, 3 );333 add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 );334 add_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' );343 add_action( 'delete_post', '_wp_delete_post_menu_item' ); 344 add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 ); 345 add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 ); 346 add_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' ); 335 347 336 348 // Post Thumbnail CSS class filtering 337 add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' );338 add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' );349 add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); 350 add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); 339 351 340 352 // Redirect Old Slugs 341 add_action( 'template_redirect', 'wp_old_slug_redirect');342 add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 );353 add_action( 'template_redirect', 'wp_old_slug_redirect' ); 354 add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 ); 343 355 add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 ); 344 356 … … 350 362 351 363 // Timezone 352 add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' );364 add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' ); 353 365 354 366 // Admin Color Schemes 355 add_action( 'admin_init', 'register_admin_color_schemes', 1 );367 add_action( 'admin_init', 'register_admin_color_schemes', 1 ); 356 368 add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); 357 369 … … 367 379 // Check if the user is logged out 368 380 add_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); 369 add_filter( 'heartbeat_send', 'wp_auth_check' );381 add_filter( 'heartbeat_send', 'wp_auth_check' ); 370 382 add_filter( 'heartbeat_nopriv_send', 'wp_auth_check' ); 371 383 372 384 // Default authentication filters 373 add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );374 add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );375 add_filter( 'authenticate', 'wp_authenticate_spam_check', 99);376 add_filter( 'determine_current_user', 'wp_validate_auth_cookie' );385 add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); 386 add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 ); 387 add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 ); 388 add_filter( 'determine_current_user', 'wp_validate_auth_cookie' ); 377 389 add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 ); 378 390 379 391 // Split term updates. 380 add_action( 'admin_init', '_wp_check_for_scheduled_split_terms' );381 add_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 );392 add_action( 'admin_init', '_wp_check_for_scheduled_split_terms' ); 393 add_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 ); 382 394 add_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 ); 383 395 add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 ); … … 388 400 add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); 389 401 add_action( 'after_password_reset', 'wp_password_change_notification' ); 390 add_action( 'register_new_user', 'wp_send_new_user_notifications' );402 add_action( 'register_new_user', 'wp_send_new_user_notifications' ); 391 403 add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 ); 392 404 393 405 // REST API actions. 394 add_action( 'init', 'rest_api_init' );395 add_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );396 add_action( 'rest_api_init', 'register_initial_settings', 10 );406 add_action( 'init', 'rest_api_init' ); 407 add_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 ); 408 add_action( 'rest_api_init', 'register_initial_settings', 10 ); 397 409 add_action( 'rest_api_init', 'create_initial_rest_routes', 99 ); 398 410 add_action( 'parse_request', 'rest_api_loaded' ); … … 423 435 add_action( 'admin_menu', '_add_post_type_submenus' ); 424 436 add_action( 'before_delete_post', '_reset_front_page_settings_for_post' ); 425 add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' );437 add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' ); 426 438 add_action( 'change_locale', 'create_initial_post_types' ); 427 439 … … 485 497 486 498 // Embeds 487 add_action( 'rest_api_init', 'wp_oembed_register_route');499 add_action( 'rest_api_init', 'wp_oembed_register_route' ); 488 500 add_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 ); 489 501 490 add_action( 'wp_head', 'wp_oembed_add_discovery_links');491 add_action( 'wp_head', 'wp_oembed_add_host_js');492 493 add_action( 'embed_head', 'enqueue_embed_scripts', 1);494 add_action( 'embed_head', 'print_emoji_detection_script');495 add_action( 'embed_head', 'print_embed_styles');496 add_action( 'embed_head', 'wp_print_head_scripts', 20);497 add_action( 'embed_head', 'wp_print_styles', 20);498 add_action( 'embed_head', 'wp_no_robots');499 add_action( 'embed_head', 'rel_canonical');500 add_action( 'embed_head', 'locale_stylesheet', 30);501 502 add_action( 'embed_content_meta', 'print_embed_comments_button');503 add_action( 'embed_content_meta', 'print_embed_sharing_button');504 505 add_action( 'embed_footer', 'print_embed_sharing_dialog');506 add_action( 'embed_footer', 'print_embed_scripts');507 add_action( 'embed_footer', 'wp_print_footer_scripts', 20);508 509 add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20);510 add_filter( 'the_excerpt_embed', 'wptexturize');511 add_filter( 'the_excerpt_embed', 'convert_chars');512 add_filter( 'the_excerpt_embed', 'wpautop');513 add_filter( 'the_excerpt_embed', 'shortcode_unautop');514 add_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment');515 516 add_filter( 'oembed_dataparse', 'wp_filter_oembed_result',10, 3 );517 add_filter( 'oembed_response_data', 'get_oembed_response_data_rich',10, 4 );518 add_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result',10, 3 );502 add_action( 'wp_head', 'wp_oembed_add_discovery_links' ); 503 add_action( 'wp_head', 'wp_oembed_add_host_js' ); 504 505 add_action( 'embed_head', 'enqueue_embed_scripts', 1 ); 506 add_action( 'embed_head', 'print_emoji_detection_script' ); 507 add_action( 'embed_head', 'print_embed_styles' ); 508 add_action( 'embed_head', 'wp_print_head_scripts', 20 ); 509 add_action( 'embed_head', 'wp_print_styles', 20 ); 510 add_action( 'embed_head', 'wp_no_robots' ); 511 add_action( 'embed_head', 'rel_canonical' ); 512 add_action( 'embed_head', 'locale_stylesheet', 30 ); 513 514 add_action( 'embed_content_meta', 'print_embed_comments_button' ); 515 add_action( 'embed_content_meta', 'print_embed_sharing_button' ); 516 517 add_action( 'embed_footer', 'print_embed_sharing_dialog' ); 518 add_action( 'embed_footer', 'print_embed_scripts' ); 519 add_action( 'embed_footer', 'wp_print_footer_scripts', 20 ); 520 521 add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 ); 522 add_filter( 'the_excerpt_embed', 'wptexturize' ); 523 add_filter( 'the_excerpt_embed', 'convert_chars' ); 524 add_filter( 'the_excerpt_embed', 'wpautop' ); 525 add_filter( 'the_excerpt_embed', 'shortcode_unautop' ); 526 add_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' ); 527 528 add_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 ); 529 add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 ); 530 add_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10, 3 ); 519 531 520 532 // Capabilities
Note: See TracChangeset
for help on using the changeset viewer.