Index: wp-signup.php
===================================================================
--- wp-signup.php (revision 18109)
+++ wp-signup.php (working copy)
@@ -211,6 +211,8 @@
$public = (int) $_POST['blog_public'];
$meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated
+ if ( has_filter( 'signup_create_blog_meta' ) )
+ _deprecated_hook( 'signup_create_blog_meta', '0.0', 'add_signup_meta' );
$meta = apply_filters( 'add_signup_meta', $meta );
wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid );
Index: wp-login.php
===================================================================
--- wp-login.php (revision 18109)
+++ wp-login.php (working copy)
@@ -195,6 +195,8 @@
$user_email = $user_data->user_email;
do_action('retreive_password', $user_login); // Misspelled and deprecated
+ if ( has_action( 'retreive_password' ) )
+ _deprecated_hook('retreive_password', '0.0', 'retrieve_password');
do_action('retrieve_password', $user_login);
$allow = apply_filters('allow_password_reset', true, $user_data->ID);
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php (revision 18109)
+++ wp-includes/post.php (working copy)
@@ -4103,6 +4103,9 @@
if ( ! $post_type_obj )
return ' 1 = 0 ';
+ if ( has_filter( 'pub_priv_sql_capability' ) )
+ _deprecated_hook( 'pub_priv_sql_capability', '3.2' );
+
// This hook is deprecated. Why you'd want to use it, I dunno.
if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) )
$cap = $post_type_obj->cap->read_private_posts;
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php (revision 18109)
+++ wp-includes/functions.php (working copy)
@@ -3432,6 +3432,7 @@
trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message );
}
}
+
/**
* Marks a function argument as deprecated and informs when it has been used.
*
@@ -3478,6 +3479,47 @@
}
/**
+ * Marks a hook as deprecated and informs when it has been used.
+ *
+ * There is a hook deprecated_hook_used that will be called that can be used
+ * to get the backtrace up to what file and function was used for the callback.
+ *
+ * The current behavior is to trigger a user error if WP_DEBUG is true.
+ *
+ * This function is to be used for every hook that is deprecated, when any callback is
+ * attacked to the hook, as determined by has_action() or has_filter(), and shall be
+ * called before the hook is fired.
+ *
+ * @package WordPress
+ * @subpackage Debug
+ * @since 2.5.0
+ * @access private
+ *
+ * @uses do_action() Calls 'deprecated_hook_used' and passes the hook name, what to use instead,
+ * the version in which the file was deprecated, and any message regarding the change.
+ * @uses apply_filters() Calls 'deprecated_hook_trigger_error' and expects boolean value of true to do
+ * trigger or false to not trigger error.
+ *
+ * @param string $file The hook that was used
+ * @param string $version The version of WordPress that deprecated the hook
+ * @param string $replacement Optional. The hook that should have been used
+ * @param string $message Optional. A message regarding the change
+ */
+function _deprecated_hook( $hook, $version, $replacement = null, $message = '' ) {
+
+ do_action( 'deprecated_hook_used', $hook, $replacement, $version, $message );
+
+ // Allow plugin to filter the output error trigger
+ if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
+ $message = empty( $message ) ? '' : ' ' . $message;
+ if ( ! is_null( $replacement ) )
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
+ else
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message );
+ }
+}
+
+/**
* Marks something as being incorrectly called.
*
* There is a hook doing_it_wrong_run that will be called that can be used
Index: wp-includes/class-wp.php
===================================================================
--- wp-includes/class-wp.php (revision 18109)
+++ wp-includes/class-wp.php (working copy)
@@ -397,6 +397,7 @@
// query_string filter deprecated. Use request filter instead.
if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in.
+ _deprecated_hook( 'query_string', '3.2', 'request' );
$this->query_string = apply_filters('query_string', $this->query_string);
parse_str($this->query_string, $this->query_vars);
}
Index: wp-admin/edit-tags.php
===================================================================
--- wp-admin/edit-tags.php (revision 18109)
+++ wp-admin/edit-tags.php (working copy)
@@ -311,12 +311,16 @@
if ( current_user_can($tax->cap->edit_terms) ) {
// Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
- if ( 'category' == $taxonomy )
+ if ( 'category' == $taxonomy && has_action( 'add_category_form_pre' ) ) {
+ _deprecated_hook( 'add_category_form_pre', '3.0', 'category_pre_add_form' );
do_action('add_category_form_pre', (object)array('parent' => 0) );
- elseif ( 'link_category' == $taxonomy )
+ } elseif ( 'link_category' == $taxonomy && has_action( 'add_link_category_form_pre' ) ) {
+ _deprecated_hook( 'add_link_category_form_pre', '3.1', 'link_category_pre_add_form' );
do_action('add_link_category_form_pre', (object)array('parent' => 0) );
- else
+ } elseif ( has_action( 'add_tag_form_pre' ) ) {
+ _deprecated_hook( 'add_tag_form_pre', '3.0', '{$taxonomy}_pre_add_form' ); // [sic]
do_action('add_tag_form_pre', $taxonomy);
+ }
do_action($taxonomy . '_pre_add_form', $taxonomy);
?>
@@ -365,12 +369,16 @@
submit_button( $tax->labels->add_new_item, 'button' );
// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
-if ( 'category' == $taxonomy )
+if ( 'category' == $taxonomy && has_action( 'edit_category_form' ) ) {
+ _deprecated_hook( 'edit_category_form', '3.0', 'category_add_form' );
do_action('edit_category_form', (object)array('parent' => 0) );
-elseif ( 'link_category' == $taxonomy )
+} elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form' ) ) {
+ _deprecated_hook( 'edit_link_category_form', '3.1', 'link_category_add_form' );
do_action('edit_link_category_form', (object)array('parent' => 0) );
-else
+} elseif ( has_action( 'add_tag_form' ) ) {
+ _deprecated_hook( 'add_tag_form', '3.0', '{$taxonomy}_add_form' ); // [sic]
do_action('add_tag_form', $taxonomy);
+}
do_action($taxonomy . '_add_form', $taxonomy);
?>
Index: wp-admin/edit-tag-form.php
===================================================================
--- wp-admin/edit-tag-form.php (revision 18109)
+++ wp-admin/edit-tag-form.php (working copy)
@@ -17,12 +17,16 @@
}
// Back compat hooks
-if ( 'category' == $taxonomy )
+if ( 'category' == $taxonomy && has_action( 'edit_category_form_pre' ) ) {
+ _deprecated_hook( 'edit_category_form_pre', '3.0', 'category_pre_edit_form' );
do_action('edit_category_form_pre', $tag );
-elseif ( 'link_category' == $taxonomy )
+} elseif ( 'link_category' == $taxonomy && has_action( 'edit_link_category_form_pre' ) ) {
+ _deprecated_hook( 'edit_link_category_form_pre', '3.1', 'link_category_pre_edit_form' );
do_action('edit_link_category_form_pre', $tag );
-else
+} elseif ( has_action( 'edit_tag_form_pre' ) ) {
+ _deprecated_hook( 'edit_tag_form_pre', '3.0', '{$taxonomy}_pre_edit_form' );
do_action('edit_tag_form_pre', $tag);
+}
do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
@@ -66,24 +70,32 @@