Ticket #14671: 14671.2.diff
File 14671.2.diff, 4.5 KB (added by , 15 years ago) |
---|
-
default-filters.php
38 38 39 39 // Email saves 40 40 foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) { 41 add_filter( $filter, 'trim' 41 add_filter( $filter, 'trim', null, 1 ); 42 42 add_filter( $filter, 'sanitize_email' ); 43 43 add_filter( $filter, 'wp_filter_kses' ); 44 44 } … … 93 93 // Format titles 94 94 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { 95 95 add_filter( $filter, 'wptexturize' ); 96 add_filter( $filter, 'strip_tags' );96 add_filter( $filter, 'strip_tags', null, 1 ); 97 97 } 98 98 99 99 // Format text area for display. … … 112 112 // Display filters 113 113 add_filter( 'the_title', 'wptexturize' ); 114 114 add_filter( 'the_title', 'convert_chars' ); 115 add_filter( 'the_title', 'trim' 115 add_filter( 'the_title', 'trim', null, 1 ); 116 116 117 117 add_filter( 'the_content', 'wptexturize' ); 118 118 add_filter( 'the_content', 'convert_smilies' ); … … 143 143 add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 ); 144 144 145 145 // RSS filters 146 add_filter( 'the_title_rss', 'strip_tags' 146 add_filter( 'the_title_rss', 'strip_tags', null, 1 ); 147 147 add_filter( 'the_title_rss', 'ent2ncr', 8 ); 148 148 add_filter( 'the_title_rss', 'esc_html' ); 149 149 add_filter( 'the_content_rss', 'ent2ncr', 8 ); … … 172 172 add_filter( 'the_posts', '_close_comments_for_old_posts' ); 173 173 add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); 174 174 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); 175 add_filter( 'editable_slug', 'urldecode' 175 add_filter( 'editable_slug', 'urldecode', 10, 1 ); 176 176 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 177 177 178 178 // Atom SSL support -
plugin.php
62 62 * @param int $accepted_args optional. The number of arguments the function accept (default 1). 63 63 * @return boolean true 64 64 */ 65 function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {65 function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = null) { 66 66 global $wp_filter, $merged_filters; 67 67 68 68 $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority); … … 247 247 * @param int $accepted_args optional. The number of arguments the function accpets (default: 1). 248 248 * @return boolean Whether the function existed before it was removed. 249 249 */ 250 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {250 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = null) { 251 251 $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority); 252 252 253 253 $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); … … 321 321 * @param int $priority optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. 322 322 * @param int $accepted_args optional. The number of arguments the function accept (default 1). 323 323 */ 324 function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {324 function add_action($tag, $function_to_add, $priority = 10, $accepted_args = null) { 325 325 return add_filter($tag, $function_to_add, $priority, $accepted_args); 326 326 } 327 327 … … 507 507 * @param string $tag The action hook to which the function to be removed is hooked. 508 508 * @param callback $function_to_remove The name of the function which should be removed. 509 509 * @param int $priority optional The priority of the function (default: 10). 510 * @param int $accepted_args optional. The number of arguments the function acc pets (default: 1).510 * @param int $accepted_args optional. The number of arguments the function accepts (default: 1). 511 511 * @return boolean Whether the function is removed. 512 512 */ 513 function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {513 function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = null) { 514 514 return remove_filter($tag, $function_to_remove, $priority, $accepted_args); 515 515 } 516 516