Ticket #17559: deprecated_hook.diff
File deprecated_hook.diff, 9.3 KB (added by , 14 years ago) |
---|
-
wp-signup.php
211 211 212 212 $public = (int) $_POST['blog_public']; 213 213 $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated 214 if ( has_filter( 'signup_create_blog_meta' ) ) 215 _deprecated_hook( 'signup_create_blog_meta', '0.0', 'add_signup_meta' ); 214 216 $meta = apply_filters( 'add_signup_meta', $meta ); 215 217 216 218 wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid ); -
wp-login.php
195 195 $user_email = $user_data->user_email; 196 196 197 197 do_action('retreive_password', $user_login); // Misspelled and deprecated 198 if ( has_action( 'retreive_password' ) ) 199 _deprecated_hook('retreive_password', '0.0', 'retrieve_password'); 198 200 do_action('retrieve_password', $user_login); 199 201 200 202 $allow = apply_filters('allow_password_reset', true, $user_data->ID); -
wp-includes/post.php
4103 4103 if ( ! $post_type_obj ) 4104 4104 return ' 1 = 0 '; 4105 4105 4106 if ( has_filter( 'pub_priv_sql_capability' ) ) 4107 _deprecated_hook( 'pub_priv_sql_capability', '3.2' ); 4108 4106 4109 // This hook is deprecated. Why you'd want to use it, I dunno. 4107 4110 if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) 4108 4111 $cap = $post_type_obj->cap->read_private_posts; -
wp-includes/functions.php
3432 3432 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message ); 3433 3433 } 3434 3434 } 3435 3435 3436 /** 3436 3437 * Marks a function argument as deprecated and informs when it has been used. 3437 3438 * … … 3478 3479 } 3479 3480 3480 3481 /** 3482 * Marks a hook as deprecated and informs when it has been used. 3483 * 3484 * There is a hook deprecated_hook_used that will be called that can be used 3485 * to get the backtrace up to what file and function was used for the callback. 3486 * 3487 * The current behavior is to trigger a user error if WP_DEBUG is true. 3488 * 3489 * This function is to be used for every hook that is deprecated, when any callback is 3490 * attacked to the hook, as determined by has_action() or has_filter(), and shall be 3491 * called before the hook is fired. 3492 * 3493 * @package WordPress 3494 * @subpackage Debug 3495 * @since 2.5.0 3496 * @access private 3497 * 3498 * @uses do_action() Calls 'deprecated_hook_used' and passes the hook name, what to use instead, 3499 * the version in which the file was deprecated, and any message regarding the change. 3500 * @uses apply_filters() Calls 'deprecated_hook_trigger_error' and expects boolean value of true to do 3501 * trigger or false to not trigger error. 3502 * 3503 * @param string $file The hook that was used 3504 * @param string $version The version of WordPress that deprecated the hook 3505 * @param string $replacement Optional. The hook that should have been used 3506 * @param string $message Optional. A message regarding the change 3507 */ 3508 function _deprecated_hook( $hook, $version, $replacement = null, $message = '' ) { 3509 3510 do_action( 'deprecated_hook_used', $hook, $replacement, $version, $message ); 3511 3512 // Allow plugin to filter the output error trigger 3513 if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) { 3514 $message = empty( $message ) ? '' : ' ' . $message; 3515 if ( ! is_null( $replacement ) ) 3516 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message ); 3517 else 3518 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message ); 3519 } 3520 } 3521 3522 /** 3481 3523 * Marks something as being incorrectly called. 3482 3524 * 3483 3525 * There is a hook doing_it_wrong_run that will be called that can be used -
wp-includes/class-wp.php
397 397 398 398 // query_string filter deprecated. Use request filter instead. 399 399 if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. 400 _deprecated_hook( 'query_string', '3.2', 'request' ); 400 401 $this->query_string = apply_filters('query_string', $this->query_string); 401 402 parse_str($this->query_string, $this->query_vars); 402 403 } -
wp-admin/edit-tags.php
311 311 312 312 if ( current_user_can($tax->cap->edit_terms) ) { 313 313 // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form 314 if ( 'category' == $taxonomy ) 314 if ( 'category' == $taxonomy && has_action( 'add_category_form_pre' ) ) { 315 _deprecated_hook( 'add_category_form_pre', '3.0', 'category_pre_add_form' ); 315 316 do_action('add_category_form_pre', (object)array('parent' => 0) ); 316 elseif ( 'link_category' == $taxonomy ) 317 } elseif ( 'link_category' == $taxonomy && has_action( 'add_link_category_form_pre' ) ) { 318 _deprecated_hook( 'add_link_category_form_pre', '3.1', 'link_category_pre_add_form' ); 317 319 do_action('add_link_category_form_pre', (object)array('parent' => 0) ); 318 else 320 } elseif ( has_action( 'add_tag_form_pre' ) ) { 321 _deprecated_hook( 'add_tag_form_pre', '3.0', '{$taxonomy}_pre_add_form' ); // [sic] 319 322 do_action('add_tag_form_pre', $taxonomy); 323 } 320 324 321 325 do_action($taxonomy . '_pre_add_form', $taxonomy); 322 326 ?> … … 365 369 submit_button( $tax->labels->add_new_item, 'button' ); 366 370 367 371 // Back compat hooks. Deprecated in preference to {$taxonomy}_add_form 368 if ( 'category' == $taxonomy ) 372 if ( 'category' == $taxonomy && has_action( 'edit_category_form' ) ) { 373 _deprecated_hook( 'edit_category_form', '3.0', 'category_add_form' ); 369 374 do_action('edit_category_form', (object)array('parent' => 0) ); 370 elseif ( 'link_category' == $taxonomy ) 375 } elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form' ) ) { 376 _deprecated_hook( 'edit_link_category_form', '3.1', 'link_category_add_form' ); 371 377 do_action('edit_link_category_form', (object)array('parent' => 0) ); 372 else 378 } elseif ( has_action( 'add_tag_form' ) ) { 379 _deprecated_hook( 'add_tag_form', '3.0', '{$taxonomy}_add_form' ); // [sic] 373 380 do_action('add_tag_form', $taxonomy); 381 } 374 382 375 383 do_action($taxonomy . '_add_form', $taxonomy); 376 384 ?> -
wp-admin/edit-tag-form.php
17 17 } 18 18 19 19 // Back compat hooks 20 if ( 'category' == $taxonomy ) 20 if ( 'category' == $taxonomy && has_action( 'edit_category_form_pre' ) ) { 21 _deprecated_hook( 'edit_category_form_pre', '3.0', 'category_pre_edit_form' ); 21 22 do_action('edit_category_form_pre', $tag ); 22 elseif ( 'link_category' == $taxonomy ) 23 } elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form_pre' ) ) { 24 _deprecated_hook( 'edit_link_category_form_pre', '3.1', 'link_category_pre_edit_form' ); 23 25 do_action('edit_link_category_form_pre', $tag ); 24 else 26 } elseif ( has_action( 'edit_tag_form_pre' ) ) { 27 _deprecated_hook( 'edit_tag_form_pre', '3.0', '{$taxonomy}_pre_edit_form' ); 25 28 do_action('edit_tag_form_pre', $tag); 29 } 26 30 27 31 do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?> 28 32 … … 66 70 </tr> 67 71 <?php 68 72 // Back compat hooks 69 if ( 'category' == $taxonomy ) 73 if ( 'category' == $taxonomy && has_action( 'edit_category_form_fields' ) ) { 74 _deprecated_hook( 'edit_category_form_fields', '3.0', 'category_edit_form_fields' ); 70 75 do_action('edit_category_form_fields', $tag); 71 elseif ( 'link_category' == $taxonomy ) 76 } elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form_fields' ) ) { 77 _deprecated_hook( 'edit_link_category_form_fields', '3.1', 'link_category_edit_form_fields' ); 72 78 do_action('edit_link_category_form_fields', $tag); 73 else 79 } elseif ( has_action( 'edit_tag_form_fields' ) ) { 80 _deprecated_hook( 'edit_tag_form_fields', '3.0', '{$taxonomy}_edit_form_fields' ); // [sic] 74 81 do_action('edit_tag_form_fields', $tag); 82 } 75 83 76 84 do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy); 77 85 ?> 78 86 </table> 79 87 <?php 80 88 // Back compat hooks 81 if ( 'category' == $taxonomy ) 89 if ( 'category' == $taxonomy && has_action( 'edit_category_form' ) ) { 90 _deprecated_hook( 'edit_category_form', '3.0', 'category_edit_form' ); 82 91 do_action('edit_category_form', $tag); 83 elseif ( 'link_category' == $taxonomy ) 92 } elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form' ) ) { 93 _deprecated_hook( 'edit_link_category_form', '3.1', 'link_category_edit_form' ); 84 94 do_action('edit_link_category_form', $tag); 85 else 95 } elseif ( has_action( 'edit_tag_form' ) ) { 96 _deprecated_hook( 'edit_tag_form', '3.0', '{$taxonomy}_edit_form' ); // [sic] 86 97 do_action('edit_tag_form', $tag); 98 } 87 99 88 100 do_action($taxonomy . '_edit_form', $tag, $taxonomy); 89 101