Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/default-filters.php

    r17465 r17406  
    2222// Strip, kses, special chars for string display
    2323foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {
    24     if ( is_admin() ) {
    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'       );
    28     }
     24    add_filter( $filter, 'sanitize_text_field'  );
     25    add_filter( $filter, 'wp_kses_data'       );
    2926    add_filter( $filter, '_wp_specialchars', 30 );
    3027}
     
    3633
    3734// Kses only for textarea admin displays
    38 if ( is_admin() ) {
    39     foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
    40         add_filter( $filter, 'wp_kses_data' );
    41     }
    42     add_filter( 'comment_text', 'wp_kses_post' );
     35foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description', 'comment_text' ) as $filter ) {
     36    add_filter( $filter, 'wp_kses_data' );
    4337}
    4438
     
    5044}
    5145
    52 // Email admin display
     46// Email display
    5347foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) {
    5448    add_filter( $filter, 'sanitize_email' );
    55     if ( is_admin() )
    56         add_filter( $filter, 'wp_kses_data' );
     49    add_filter( $filter, 'wp_kses_data' );
    5750}
    5851
     
    6760// Display URL
    6861foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) {
    69     if ( is_admin() )
    70         add_filter( $filter, 'wp_strip_all_tags' );
     62    add_filter( $filter, 'wp_strip_all_tags' );
    7163    add_filter( $filter, 'esc_url'           );
    72     if ( is_admin() )
    73         add_filter( $filter, 'wp_kses_data'    );
     64    add_filter( $filter, 'wp_kses_data'    );
    7465}
    7566
     
    10091
    10192// Format WordPress
    102 foreach ( array( 'the_content', 'the_title' ) as $filter )
     93foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter )
    10394    add_filter( $filter, 'capital_P_dangit', 11 );
    104 add_filter( 'comment_text', 'capital_P_dangit', 31 );
    10595
    10696// Format titles
     
    123113}
    124114
    125 // Pre save hierarchy
    126 add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 );
    127 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );
    128 
    129115// Display filters
    130116add_filter( 'the_title', 'wptexturize'   );
     
    156142
    157143add_filter( 'list_cats',         'wptexturize' );
     144add_filter( 'single_post_title', 'wptexturize' );
    158145
    159146add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );
     
    215202add_action( 'wp_head',             'wp_shortlink_wp_head',          10, 0 );
    216203add_action( 'template_redirect',   'wp_shortlink_header',           11, 0 );
    217 
    218 // Login actions
    219 add_action( 'login_head',          'wp_print_head_scripts',         9     );
    220 add_action( 'login_footer',        'wp_print_footer_scripts'              );
    221204
    222205// Feed Generator Tags
     
    274257add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    275258
    276 unset($filter, $action);
    277 
    278259?>
Note: See TracChangeset for help on using the changeset viewer.