Make WordPress Core

Opened 8 years ago

Last modified 3 weeks ago

#34986 new enhancement

Add Upgrade Notice for Themes

Reported by: afragen's profile afragen Owned by:
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:

Description

There is upgrade notice for plugins that displays on the core update page if $transient->upgrade_notice is set in the pre_set_site_transient_update_{plugins|themes} filter, but there is no corresponding upgrade notice used or available for themes.

I propose adding a similar usage for themes as currently exists for plugins.

Use case, when theme upgrades are pending a notice of what changes, etc. will be available from the main update page.

Attachments (1)

34986.diff (1.4 KB) - added by afragen 8 years ago.

Download all attachments as: .zip

Change History (13)

@afragen
8 years ago

#1 @afragen
8 years ago

  • Keywords has-patch added

#2 @johnbillion
7 years ago

  • Version trunk deleted

#3 @afragen
7 years ago

Any comments?

This ticket was mentioned in Slack in #core-upgrade-install by costdev. View the logs.


3 months ago

#5 @costdev
3 months ago

  • Milestone set to 6.3

#6 @costdev
3 months ago

  • Keywords needs-testing needs-testing-info added

@afragen Can you drop some testing info so that the patch can be tested? Thanks!

Additional props: @pbiron

#7 @afragen
3 months ago

  • Keywords needs-refresh added

This ticket was mentioned in PR #4238 on WordPress/wordpress-develop by @afragen.


3 months ago
#8

  • Keywords needs-refresh removed

Updated PR for adding an upgrade notice to theme updates in update-core.php as there is for plugin updates.

Trac ticket: https://core.trac.wordpress.org/ticket/34986

#9 @afragen
3 months ago

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.

#10 @afragen
3 months ago

Above is for testing. I'm pretty sure all the dev needs to do is add a section == Upgrade Notice == to their readme.txt for the specific update and the readme parser in dot org will add the data to the update transient.

#11 @afragen
3 months ago

  • Keywords needs-testing-info removed

This ticket was mentioned in Slack in #core-upgrade-install by pbiron. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.