Coding Standards: Consistently use do_action_deprecated() and apply_filters_deprecated() for deprecated hooks.

Props jrf.
See #48255.

git-svn-id: https://develop.svn.wordpress.org/trunk@46684 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-11-09 12:57:27 +00:00
parent 243d1a2e38
commit ae2ebb8b18
14 changed files with 57 additions and 37 deletions

View File

@@ -796,7 +796,12 @@ final class WP_Screen {
* @param array $old_compat_help Old contextual help.
* @param WP_Screen $this Current WP_Screen instance.
*/
self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
self::$_old_compat_help = apply_filters_deprecated(
'contextual_help_list',
array( self::$_old_compat_help, $this ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
$old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
@@ -811,7 +816,12 @@ final class WP_Screen {
* @param string $screen_id Screen ID.
* @param WP_Screen $this Current WP_Screen instance.
*/
$old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
$old_help = apply_filters_deprecated(
'contextual_help',
array( $old_help, $this->id, $this ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
// Default help only if there is no old-style block of text and no new-style help tabs.
if ( empty( $old_help ) && ! $this->get_help_tabs() ) {
@@ -825,7 +835,12 @@ final class WP_Screen {
*
* @param string $old_help_default Default contextual help text.
*/
$default_help = apply_filters( 'default_contextual_help', '' );
$default_help = apply_filters_deprecated(
'default_contextual_help',
array( '' ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
if ( $default_help ) {
$old_help = '<p>' . $default_help . '</p>';
}