Make WordPress Core

Changeset 57148


Ignore:
Timestamp:
12/01/2023 01:33:40 AM (13 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Add port number to target origin when decrementing update counts.

This ensures that the update counter bubble in the admin menu is properly decreased after a successful plugin or theme update from within the update iframe when the site uses a non-standard port number.

Follow-up to [27280], [29357].

Props TobiasBg.
Fixes #59987.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader-skin.php

    r55988 r57148  
    241241            echo '<script type="text/javascript">
    242242                    if ( window.postMessage && JSON ) {
    243                         window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
     243                        window.parent.postMessage(
     244                            JSON.stringify( {
     245                                action: "decrementUpdateCount",
     246                                upgradeType: "' . $type . '"
     247                            } ),
     248                            window.location.protocol + "//" + window.location.hostname
     249                                + ( "" !== window.location.port ? ":" + window.location.port : "" )
     250                        );
    244251                    }
    245252                </script>';
Note: See TracChangeset for help on using the changeset viewer.