[wp-trac] [WordPress Trac] #50663: Add filter for the plugin/theme auto-update message in the Info tab of Site health
WordPress Trac
noreply at wordpress.org
Tue Jul 21 16:43:32 UTC 2020
#50663: Add filter for the plugin/theme auto-update message in the Info tab of Site
health
--------------------------------------+---------------------
Reporter: pbiron | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5
Component: Site Health | Version:
Severity: normal | Resolution:
Keywords: needs-dev-note has-patch | Focuses:
--------------------------------------+---------------------
Changes (by audrasjb):
* keywords: needs-patch needs-dev-note => needs-dev-note has-patch
Comment:
To test this patch, you can use the following snippet:
{{{#!php
<?php
function jba_plugin_auto_update_debug_str( $str, $plugin, $enabled ) {
if ( in_array( $plugin['Name'], [ 'Hello Dolly', 'Reusable Blocks
Extended', 'GDPR Data Request Form' ], true ) ) {
$str = __( 'Auto-updates are not available for this
plugin' );
}
return $str;
}
add_filter( 'plugin_auto_update_debug_str',
'jba_plugin_auto_update_debug_str', 10, 3 );
function jba_theme_auto_update_debug_str( $str, $theme, $enabled ) {
if ( in_array( $theme->name, [ 'Twenty Twenty', 'Twenty Nineteen',
'Twenty Eleven' ], true ) ) {
$str = __( 'Auto-updates are not available for this theme'
);
}
return $str;
}
add_filter( 'theme_auto_update_debug_str',
'jba_theme_auto_update_debug_str', 10, 3 );
}}}
Of course, don't forget to replace the plugin names :-)
Cheers,
jb
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50663#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list