-
+ 1C4DF56D9E66F982BE8931E6348B4DF29EC552B250DC985C6E35639137C2AAD09DDF71C031EC2B7FCDC62CF05853DE091C666AC8B4C4ADF7CFD37798E3C96C6D
mp-wp/wp-includes/default-filters.php
(0 . 0)(1 . 202)
87027 <?php
87028 /**
87029 * Sets up the default filters and actions for most
87030 * of the WordPress hooks.
87031 *
87032 * If you need to remove a default hook, this file will
87033 * give you the priority for which to use to remove the
87034 * hook.
87035 *
87036 * Not all of the default hooks are found in default-filters.php
87037 *
87038 * @package WordPress
87039 */
87040
87041 // Strip, trim, kses, special chars for string saves
87042 $filters = array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target',
87043 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name',
87044 'pre_user_nickname');
87045 foreach ( $filters as $filter ) {
87046 add_filter($filter, 'strip_tags');
87047 add_filter($filter, 'trim');
87048 add_filter($filter, 'wp_filter_kses');
87049 add_filter($filter, 'wp_specialchars', 30);
87050 }
87051
87052 // Kses only for textarea saves
87053 $filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description');
87054 foreach ( $filters as $filter ) {
87055 add_filter($filter, 'wp_filter_kses');
87056 }
87057
87058 // Email
87059 $filters = array('pre_comment_author_email', 'pre_user_email');
87060 foreach ( $filters as $filter ) {
87061 add_filter($filter, 'trim');
87062 add_filter($filter, 'sanitize_email');
87063 add_filter($filter, 'wp_filter_kses');
87064 }
87065
87066 // Save URL
87067 $filters = array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
87068 'pre_link_rss');
87069 foreach ( $filters as $filter ) {
87070 add_filter($filter, 'strip_tags');
87071 add_filter($filter, 'trim');
87072 add_filter($filter, 'sanitize_url');
87073 add_filter($filter, 'wp_filter_kses');
87074 }
87075
87076 // Display URL
87077 $filters = array('user_url', 'link_url', 'link_image', 'link_rss', 'comment_url');
87078 foreach ( $filters as $filter ) {
87079 add_filter($filter, 'strip_tags');
87080 add_filter($filter, 'trim');
87081 add_filter($filter, 'clean_url');
87082 add_filter($filter, 'wp_filter_kses');
87083 }
87084
87085 // Slugs
87086 $filters = array('pre_term_slug');
87087 foreach ( $filters as $filter ) {
87088 add_filter($filter, 'sanitize_title');
87089 }
87090
87091 // Keys
87092 $filters = array('pre_post_type');
87093 foreach ( $filters as $filter ) {
87094 add_filter($filter, 'sanitize_user');
87095 }
87096
87097 // Places to balance tags on input
87098 $filters = array('content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content');
87099 foreach ( $filters as $filter ) {
87100 add_filter( $filter, 'balanceTags', 50);
87101 }
87102
87103 // Format strings for display.
87104 $filters = array('comment_author', 'term_name', 'link_name', 'link_description',
87105 'link_notes', 'bloginfo', 'wp_title');
87106 foreach ( $filters as $filter ) {
87107 add_filter($filter, 'wptexturize');
87108 add_filter($filter, 'convert_chars');
87109 add_filter($filter, 'wp_specialchars');
87110 }
87111
87112 // Format text area for display.
87113 $filters = array('term_description');
87114 foreach ( $filters as $filter ) {
87115 add_filter($filter, 'wptexturize');
87116 add_filter($filter, 'convert_chars');
87117 add_filter($filter, 'wpautop');
87118 }
87119
87120 // Format for RSS
87121 $filters = array('term_name_rss');
87122 foreach ( $filters as $filter ) {
87123 add_filter($filter, 'convert_chars');
87124 }
87125
87126 // Display filters
87127 add_filter('the_title', 'wptexturize');
87128 add_filter('the_title', 'convert_chars');
87129 add_filter('the_title', 'trim');
87130
87131 add_filter('the_content', 'wptexturize');
87132 add_filter('the_content', 'convert_smilies');
87133 add_filter('the_content', 'convert_chars');
87134 add_filter('the_content', 'wpautop');
87135 add_filter('the_content', 'prepend_attachment');
87136
87137 add_filter('the_excerpt', 'wptexturize');
87138 add_filter('the_excerpt', 'convert_smilies');
87139 add_filter('the_excerpt', 'convert_chars');
87140 add_filter('the_excerpt', 'wpautop');
87141 add_filter('get_the_excerpt', 'wp_trim_excerpt');
87142
87143 add_filter('comment_text', 'wptexturize');
87144 add_filter('comment_text', 'convert_chars');
87145 add_filter('comment_text', 'make_clickable', 9);
87146 add_filter('comment_text', 'force_balance_tags', 25);
87147 add_filter('comment_text', 'convert_smilies', 20);
87148 add_filter('comment_text', 'wpautop', 30);
87149
87150 add_filter('comment_excerpt', 'convert_chars');
87151
87152 add_filter('list_cats', 'wptexturize');
87153 add_filter('single_post_title', 'wptexturize');
87154
87155 add_filter('wp_sprintf', 'wp_sprintf_l', 10, 2);
87156
87157 // RSS filters
87158 add_filter('the_title_rss', 'strip_tags');
87159 add_filter('the_title_rss', 'ent2ncr', 8);
87160 add_filter('the_title_rss', 'wp_specialchars');
87161 add_filter('the_content_rss', 'ent2ncr', 8);
87162 add_filter('the_excerpt_rss', 'convert_chars');
87163 add_filter('the_excerpt_rss', 'ent2ncr', 8);
87164 add_filter('comment_author_rss', 'ent2ncr', 8);
87165 add_filter('comment_text_rss', 'ent2ncr', 8);
87166 add_filter('comment_text_rss', 'wp_specialchars');
87167 add_filter('bloginfo_rss', 'ent2ncr', 8);
87168 add_filter('the_author', 'ent2ncr', 8);
87169
87170 // Misc filters
87171 add_filter('option_ping_sites', 'privacy_ping_filter');
87172 add_filter('option_blog_charset', 'wp_specialchars');
87173 add_filter('option_home', '_config_wp_home');
87174 add_filter('option_siteurl', '_config_wp_siteurl');
87175 add_filter('tiny_mce_before_init', '_mce_set_direction');
87176 add_filter('pre_kses', 'wp_pre_kses_less_than');
87177 add_filter('sanitize_title', 'sanitize_title_with_dashes');
87178 add_action('check_comment_flood', 'check_comment_flood_db', 10, 3);
87179 add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3);
87180 add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
87181 add_filter('comment_email', 'antispambot');
87182 add_filter('option_tag_base', '_wp_filter_taxonomy_base');
87183 add_filter('option_category_base', '_wp_filter_taxonomy_base');
87184 add_filter( 'the_posts', '_close_comments_for_old_posts' );
87185 add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 );
87186 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 );
87187 add_filter( 'editable_slug', 'urldecode' );
87188
87189 // Atom SSL support
87190 add_filter('atom_service_url','atom_service_url_filter');
87191
87192 // Actions
87193 add_action('wp_head', 'rsd_link');
87194 add_action('wp_head', 'wlwmanifest_link');
87195 add_action('wp_head', 'locale_stylesheet');
87196 add_action('publish_future_post', 'check_and_publish_future_post', 10, 1);
87197 add_action('wp_head', 'noindex', 1);
87198 add_action('wp_head', 'wp_print_styles', 9);
87199 add_action('wp_head', 'wp_print_scripts');
87200 add_action('wp_head', 'wp_generator');
87201 if(!defined('DOING_CRON'))
87202 add_action('init', 'wp_cron');
87203 add_action('do_feed_rdf', 'do_feed_rdf', 10, 1);
87204 add_action('do_feed_rss', 'do_feed_rss', 10, 1);
87205 add_action('do_feed_rss2', 'do_feed_rss2', 10, 1);
87206 add_action('do_feed_atom', 'do_feed_atom', 10, 1);
87207 add_action('do_pings', 'do_all_pings', 10, 1);
87208 add_action('do_robots', 'do_robots');
87209 add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
87210 add_action('admin_print_scripts', 'wp_print_scripts', 20);
87211 add_action('admin_print_styles', 'wp_print_styles', 20);
87212 add_action('init', 'smilies_init', 5);
87213 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
87214 add_action( 'shutdown', 'wp_ob_end_flush_all', 1);
87215 add_action( 'pre_post_update', 'wp_save_post_revision' );
87216 add_action('publish_post', '_publish_post_hook', 5, 1);
87217 add_action('future_post', '_future_post_hook', 5, 2);
87218 add_action('future_page', '_future_post_hook', 5, 2);
87219 add_action('save_post', '_save_post_hook', 5, 2);
87220 add_action('transition_post_status', '_transition_post_status', 5, 3);
87221 add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce');
87222 // Redirect Old Slugs
87223 add_action('template_redirect', 'wp_old_slug_redirect');
87224 add_action('edit_post', 'wp_check_for_changed_slugs');
87225 add_action('edit_form_advanced', 'wp_remember_old_slug');
87226 add_action('init', '_show_post_preview');
87227
87228 ?>