Ticket #10441: 10441.do_deprecated_action.patch
File 10441.do_deprecated_action.patch, 11.4 KB (added by , 13 years ago) |
---|
-
wp-admin/edit-tag-form.php
18 18 19 19 // Back compat hooks 20 20 if ( 'category' == $taxonomy ) 21 do_ action('edit_category_form_pre', $tag);21 do_deprecated_action( 'edit_category_form_pre', array( $tag ), '3.0', 'category_pre_edit_form' ); 22 22 elseif ( 'link_category' == $taxonomy ) 23 do_ action('edit_link_category_form_pre', $tag);23 do_deprecated_action( 'edit_link_category_form_pre', array( $tag ), '3.1', 'link_category_pre_edit_form' ); 24 24 else 25 do_ action('edit_tag_form_pre', $tag);25 do_deprecated_action( 'edit_tag_form_pre', array( $tag ), '3.0', '{$taxonomy}_pre_edit_form' ); // [sic] 26 26 27 do_action( $taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>27 do_action( $taxonomy . '_pre_edit_form', $tag, $taxonomy ); ?> 28 28 29 29 <div class="wrap"> 30 30 <?php screen_icon(); ?> … … 67 67 <?php 68 68 // Back compat hooks 69 69 if ( 'category' == $taxonomy ) 70 do_ action('edit_category_form_fields', $tag);70 do_deprecated_action( 'edit_category_form_fields', array( $tag ), '3.0', 'category_edit_form_fields' ); 71 71 elseif ( 'link_category' == $taxonomy ) 72 do_ action('edit_link_category_form_fields', $tag);72 do_deprecated_action( 'edit_link_category_form_fields', array( $tag ), '3.1', 'link_category_edit_form_fields' ); 73 73 else 74 do_ action('edit_tag_form_fields', $tag);74 do_deprecated_action( 'edit_tag_form_fields', array( $tag ), '3.0', '{$taxonomy}_edit_form_fields' ); // [sic] 75 75 76 do_action( $taxonomy . '_edit_form_fields', $tag, $taxonomy);76 do_action( $taxonomy . '_edit_form_fields', $tag, $taxonomy ); 77 77 ?> 78 78 </table> 79 79 <?php 80 80 // Back compat hooks 81 81 if ( 'category' == $taxonomy ) 82 do_ action('edit_category_form', $tag);82 do_deprecated_action( 'edit_category_form', array( $tag ), '3.0', 'category_edit_form' ); 83 83 elseif ( 'link_category' == $taxonomy ) 84 do_ action('edit_link_category_form', $tag);84 do_deprecated_action( 'edit_link_category_form', array( $tag ), '3.1', 'link_category_edit_form' ); 85 85 else 86 do_ action('edit_tag_form', $tag);86 do_deprecated_action( 'edit_tag_form', array( $tag ), '3.0', '{$taxonomy}_edit_form' ); // [sic] 87 87 88 do_action( $taxonomy . '_edit_form', $tag, $taxonomy);88 do_action( $taxonomy . '_edit_form', $tag, $taxonomy ); 89 89 90 90 submit_button( __('Update') ); 91 91 ?> -
wp-admin/edit-tags.php
312 312 if ( current_user_can($tax->cap->edit_terms) ) { 313 313 // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form 314 314 if ( 'category' == $taxonomy ) 315 do_ action('add_category_form_pre', (object)array('parent' => 0));315 do_deprecated_action( 'add_category_form_pre', array( (object)array('parent' => 0) ), '3.0', 'category_pre_add_form' ); 316 316 elseif ( 'link_category' == $taxonomy ) 317 do_ action('add_link_category_form_pre', (object)array('parent' => 0));317 do_deprecated_action( 'add_link_category_form_pre', array( (object)array('parent' => 0) ), '3.1', 'link_category_pre_add_form' ); 318 318 else 319 do_ action('add_tag_form_pre', $taxonomy);319 do_deprecated_action( 'add_tag_form_pre', array( $taxonomy ), '3.0', '{$taxonomy}_pre_add_form' ); // [sic] 320 320 321 do_action( $taxonomy . '_pre_add_form', $taxonomy);321 do_action( $taxonomy . '_pre_add_form', $taxonomy ); 322 322 ?> 323 323 324 324 <div class="form-wrap"> … … 366 366 367 367 // Back compat hooks. Deprecated in preference to {$taxonomy}_add_form 368 368 if ( 'category' == $taxonomy ) 369 do_ action('edit_category_form', (object)array('parent' => 0));369 do_deprecated_action( 'edit_category_form', array( (object)array('parent' => 0) ), '3.0', 'category_add_form' ); 370 370 elseif ( 'link_category' == $taxonomy ) 371 do_ action('edit_link_category_form', (object)array('parent' => 0));371 do_deprecated_action( 'edit_link_category_form', array( (object)array('parent' => 0) ), '3.1', 'link_category_add_form' ); 372 372 else 373 do_action( 'add_tag_form', $taxonomy);373 do_action( 'add_tag_form', array( $taxonomy ), '3.0', '{$taxonomy}_add_form' ); // [sic] 374 374 375 do_action( $taxonomy . '_add_form', $taxonomy);375 do_action( $taxonomy . '_add_form', $taxonomy ); 376 376 ?> 377 377 </form></div> 378 378 <?php } ?> -
wp-includes/class-wp.php
403 403 404 404 // query_string filter deprecated. Use request filter instead. 405 405 if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. 406 $this->query_string = apply_ filters('query_string', $this->query_string);406 $this->query_string = apply_deprecated_filters( 'query_string', array( $this->query_string ), '3.2', 'request' ); 407 407 parse_str($this->query_string, $this->query_vars); 408 408 } 409 409 } -
wp-includes/plugin.php
785 785 } 786 786 } 787 787 788 /** 789 * Fire a deprecated filter. Wraps apply_filters(). 790 * 791 * @since 3.2.0 792 * 793 * @param string $tag The name of the filter hook. 794 * @param array $args Array of additional function arguments to be passed to apply_filters(). 795 * @param string $version The version of WordPress that deprecated the hook 796 * @param string $replacement Optional. The hook that should have been used 797 * @param string $message Optional. A message regarding the change 798 */ 799 function apply_deprecated_filters( $tag, $args, $version, $replacement = false, $message = null ) { 800 if ( ! has_filter( $tag ) ) 801 return; 802 _deprecated_hook( $tag, $version, $replacement, $message ); 803 array_unshift( $args, $tag ); 804 return call_user_func_array( 'apply_filters', $args ); 805 } 806 807 /** 808 * Fire a deprecated action. Wraps do_action(). 809 * 810 * @since 3.2.0 811 * 812 * @param string $tag The name of the filter hook. 813 * @param array $args Array of additional function arguments to be passed to do_action(). 814 * @param string $version The version of WordPress that deprecated the hook 815 * @param string $replacement Optional. The hook that should have been used 816 * @param string $message Optional. A message regarding the change 817 */ 818 function do_deprecated_action( $tag, $args, $version, $replacement = false, $message = null ) { 819 if ( ! has_action( $tag ) ) 820 return; 821 _deprecated_hook( $tag, $version, $replacement, $message ); 822 array_unshift( $args, $tag ); 823 call_user_func_array( 'do_action', $args ); 824 } 825 826 /** 827 * Marks a hook as deprecated and informs when it has been used. 828 * 829 * There is a hook deprecated_hook_used that will be called that can be used 830 * to get the backtrace up to what file and function was used for the callback. 831 * 832 * The current behavior is to trigger a user error if WP_DEBUG is true. 833 * 834 * This function is to be used for every hook that is deprecated, when any callback is 835 * attacked to the hook, as determined by has_action() or has_filter(), and shall be 836 * called before the hook is fired. 837 * 838 * @package WordPress 839 * @subpackage Debug 840 * @since 3.2.0 841 * @access private 842 * 843 * @uses do_action() Calls 'deprecated_hook_used' and passes the hook name, what to use instead, 844 * the version in which the file was deprecated, and any message regarding the change. 845 * @uses apply_filters() Calls 'deprecated_hook_trigger_error' and expects boolean value of true to do 846 * trigger or false to not trigger error. 847 * 848 * @param string $hook The hook that was used 849 * @param string $version The version of WordPress that deprecated the hook 850 * @param string $replacement Optional. The hook that should have been used 851 * @param string $message Optional. A message regarding the change 852 */ 853 function _deprecated_hook( $hook, $version, $replacement = null, $message = null ) { 854 // Allow plugin to filter the output error trigger 855 if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) { 856 $message = empty( $message ) ? '' : ' ' . $message; 857 if ( ! is_null( $replacement ) ) 858 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $hook, $version, $replacement ) . $message ); 859 else 860 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $hook, $version ) . $message ); 861 } 862 } 863 788 864 ?> -
wp-includes/post.php
4160 4160 return ' 1 = 0 '; 4161 4161 4162 4162 // This hook is deprecated. Why you'd want to use it, I dunno. 4163 if ( ! $cap = apply_ filters( 'pub_priv_sql_capability', '' ) )4163 if ( ! $cap = apply_deprecated_filters( 'pub_priv_sql_capability', array( '' ), '3.2' ) ) 4164 4164 $cap = $post_type_obj->cap->read_private_posts; 4165 4165 4166 4166 if ( $full ) { … … 4507 4507 * @since 2.3.0 4508 4508 * @access private 4509 4509 * @uses $wpdb 4510 * @uses do_action() Calls 'private_to_published' on post ID if this is a 'private_to_published' call.4511 4510 * @uses wp_clear_scheduled_hook() with 'publish_future_post' and post ID. 4512 4511 * 4513 4512 * @param string $new_status New post status … … 4521 4520 // Reset GUID if transitioning to publish and it is empty 4522 4521 if ( '' == get_the_guid($post->ID) ) 4523 4522 $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); 4524 do_ action('private_to_published', $post->ID); // Deprecated, use private_to_publish4523 do_deprecated_action( 'private_to_published', array( $post->ID ), '2.3', 'private_to_publish' ); 4525 4524 } 4526 4525 4527 4526 // If published posts changed clear the lastpostmodified cache -
wp-includes/rewrite.php
1654 1654 1655 1655 $rules .= "</IfModule>\n"; 1656 1656 1657 $rules = apply_filters( 'mod_rewrite_rules', $rules);1658 $rules = apply_ filters('rewrite_rules', $rules); // Deprecated1657 $rules = apply_filters( 'mod_rewrite_rules', $rules ); 1658 $rules = apply_deprecated_filters( 'rewrite_rules', array( $rules ), '1.5', 'mod_rewrite_rules' ); 1659 1659 1660 1660 return $rules; 1661 1661 } -
wp-login.php
194 194 $user_login = $user_data->user_login; 195 195 $user_email = $user_data->user_email; 196 196 197 do_ action('retreive_password', $user_login); // Misspelled and deprecated197 do_deprecated_action( 'retreive_password', array( $user_login ), '1.5.1', 'retrieve_password' ); // Misspelled 198 198 do_action('retrieve_password', $user_login); 199 199 200 200 $allow = apply_filters('allow_password_reset', true, $user_data->ID); -
wp-signup.php
210 210 } 211 211 212 212 $public = (int) $_POST['blog_public']; 213 $meta = apply_ filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated213 $meta = apply_deprecated_filters( 'signup_create_blog_meta', array( array( 'lang_id' => 1, 'public' => $public ) ), 'MU', 'add_signup_meta' ); 214 214 $meta = apply_filters( 'add_signup_meta', $meta ); 215 215 216 216 wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );