[wp-trac] [WordPress Trac] #34986: Add Upgrade Notice for Themes
WordPress Trac
noreply at wordpress.org
Wed Mar 15 19:47:40 UTC 2023
#34986: Add Upgrade Notice for Themes
-------------------------------------------------+-------------------------
Reporter: afragen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.3
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing needs- | Focuses:
testing-info |
-------------------------------------------------+-------------------------
Comment (by afragen):
You can test the PR with the following plugin code. Obviously this would
need to be added by the theme dev.
{{{
<?php
/**
* Plugin Name: Test #34986
* Description: Testing Trac Ticket #34986
* Author: WP Core Contributors
* Version: 0.1
*/
add_filter( 'site_transient_update_themes', 'add_upgrade_notice_34986',
20, 1 );
function add_upgrade_notice_34986($transient){
$theme_slug = 'twentytwentythree';
if ( isset($transient->response[$theme_slug])){
$transient->response[$theme_slug]['upgrade_notice'] = 'Test of
upgrade notice, #34986.';
}
return $transient;
}
}}}
To test, decrease the local version number of the Twenty Twenty Three
theme so that it shows an update.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34986#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list