Make WordPress Core


Ignore:
Timestamp:
12/01/2017 11:35:31 AM (4 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/edit.php

    r38657 r42349  
    1111require_once( dirname( __FILE__ ) . '/admin.php' );
    1212
    13 if ( empty( $_GET['action'] ) ) {
     13$action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : '';
     14
     15if ( empty( $action ) ) {
    1416    wp_redirect( network_admin_url() );
    1517    exit;
     
    2931 * Fires the requested handler action.
    3032 *
    31  * The dynamic portion of the hook name, `$_GET['action']`, refers to the name
    32  * of the requested action.
     33 * The dynamic portion of the hook name, `$action`, refers to the name
     34 * of the requested action derived from the `GET` request.
    3335 *
    3436 * @since 3.1.0
    3537 */
    36 do_action( 'network_admin_edit_' . $_GET['action'] );
     38do_action( "network_admin_edit_{$action}" );
    3739
    3840wp_redirect( network_admin_url() );
Note: See TracChangeset for help on using the changeset viewer.