[wp-trac] [WordPress Trac] #34986: Add Upgrade Notice for Themes

WordPress Trac noreply at wordpress.org
Wed Oct 8 08:11:43 UTC 2025


#34986: Add Upgrade Notice for Themes
-------------------------------------------------+-------------------------
 Reporter:  afragen                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Upgrade/Install                      |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-test-info has-         |     Focuses:
  screenshots dev-feedback                       |
-------------------------------------------------+-------------------------

Comment (by joostdekeijzer):

 For those interested, a workaround below using javascript/jQuery

 {{{#!php
 <?php
 add_action( 'core_upgrade_preamble', function() {
   // !!! Currently WordPress does not support upgrade_notice for themes
   $themes = [];
   foreach ( get_theme_updates() as $stylesheet => $theme ) {
     if ( ! empty( $theme->update['upgrade_notice'] ) ) {
       $themes[ $stylesheet ] = wp_strip_all_tags(
 $theme->update['upgrade_notice'] );
     }
   }
   if ( ! empty( $themes ) ) {
     printf( '<script type="text/javascript">jQuery( function($) { $.each(
 %s, function( index, value ) { $( "#update-themes-table
 input[type=checkbox][value=" + index + "]" ).closest( "tr" ).find( "td
 .plugin-title p" ).append( "<br />" + value ); } ); } );</script>',
 json_encode( $themes, JSON_FORCE_OBJECT ) );
   }
 } );

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/34986#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list