Make WordPress Core


Ignore:
Timestamp:
12/01/2017 11:35:31 AM (7 years ago)
Author:
DrewAPicture
Message:

Hooks: Standardize naming of dynamic hooks using values derived from superglobals to use interpolation vs concatenation.

This is a continuation of the work that happened in [38307] for #37748.

Props ramiy.
Fixes #42698.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/sites.php

    r42343 r42349  
    279279$msg = '';
    280280if ( isset( $_GET['updated'] ) ) {
    281     switch ( $_GET['updated'] ) {
     281    $action = $_GET['updated'];
     282
     283    switch ( $action ) {
    282284        case 'all_notspam':
    283285            $msg = __( 'Sites removed from spam.' );
     
    315317        default:
    316318            /**
    317              * Filters a specific, non-default site-updated message in the Network admin.
    318              *
    319              * The dynamic portion of the hook name, `$_GET['updated']`, refers to the
    320              * non-default site update action.
     319             * Filters a specific, non-default, site-updated message in the Network admin.
     320             *
     321             * The dynamic portion of the hook name, `$action`, refers to the non-default
     322             * site update action.
    321323             *
    322324             * @since 3.1.0
     
    324326             * @param string $msg The update message. Default 'Settings saved'.
    325327             */
    326             $msg = apply_filters( 'network_sites_updated_message_' . $_GET['updated'], __( 'Settings saved.' ) );
     328            $msg = apply_filters( "network_sites_updated_message_{$action}", __( 'Settings saved.' ) );
    327329            break;
    328330    }
Note: See TracChangeset for help on using the changeset viewer.