Docs: Correct usage of the dynamic auto_update_{$type} filter.

This ensures that the canonical name of the filter is used in Site Health debug data, as well as on plugin and theme screens, so the developer reference site remains correct.

Props johnbillion.
Fixes #50868.

git-svn-id: https://develop.svn.wordpress.org/trunk@48750 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-08-07 16:12:11 +00:00
parent 54cba57fa6
commit 8c11d506e1
5 changed files with 31 additions and 15 deletions

View File

@@ -971,8 +971,9 @@ class WP_Debug_Data {
$item = array_merge( $item, array_intersect_key( $plugin, $item ) );
}
/** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( 'auto_update_plugin', null, (object) $item );
$type = 'plugin';
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
if ( ! is_null( $auto_update_forced ) ) {
$enabled = $auto_update_forced;
@@ -1114,8 +1115,9 @@ class WP_Debug_Data {
);
}
/** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
$type = 'theme';
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
if ( ! is_null( $auto_update_forced ) ) {
$enabled = $auto_update_forced;
@@ -1201,8 +1203,9 @@ class WP_Debug_Data {
);
}
/** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
$type = 'theme';
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
if ( ! is_null( $auto_update_forced ) ) {
$enabled = $auto_update_forced;
@@ -1290,8 +1293,9 @@ class WP_Debug_Data {
);
}
/** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
$type = 'theme';
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
if ( ! is_null( $auto_update_forced ) ) {
$enabled = $auto_update_forced;