Make WordPress Core

Changeset 45881


Ignore:
Timestamp:
08/22/2019 07:07:57 PM (5 years ago)
Author:
desrosj
Message:

Coding Standards: Dynamic hooks should be named using interpolation not concatenation.

Props arena, desrosj.
Fixes #47052.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-custom-background.php

    r45662 r45881  
    6868        }
    6969
    70         add_action( "load-$page", array( $this, 'admin_load' ) );
    71         add_action( "load-$page", array( $this, 'take_action' ), 49 );
    72         add_action( "load-$page", array( $this, 'handle_upload' ), 49 );
     70        add_action( "load-{$page}", array( $this, 'admin_load' ) );
     71        add_action( "load-{$page}", array( $this, 'take_action' ), 49 );
     72        add_action( "load-{$page}", array( $this, 'handle_upload' ), 49 );
    7373
    7474        if ( $this->admin_header_callback ) {
    75             add_action( "admin_head-$page", $this->admin_header_callback, 51 );
     75            add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
    7676        }
    7777    }
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r45654 r45881  
    7676        }
    7777
    78         add_action( "admin_print_scripts-$page", array( $this, 'js_includes' ) );
    79         add_action( "admin_print_styles-$page", array( $this, 'css_includes' ) );
    80         add_action( "admin_head-$page", array( $this, 'help' ) );
    81         add_action( "admin_head-$page", array( $this, 'take_action' ), 50 );
    82         add_action( "admin_head-$page", array( $this, 'js' ), 50 );
     78        add_action( "admin_print_scripts-{$page}", array( $this, 'js_includes' ) );
     79        add_action( "admin_print_styles-{$page}", array( $this, 'css_includes' ) );
     80        add_action( "admin_head-{$page}", array( $this, 'help' ) );
     81        add_action( "admin_head-{$page}", array( $this, 'take_action' ), 50 );
     82        add_action( "admin_head-{$page}", array( $this, 'js' ), 50 );
    8383        if ( $this->admin_header_callback ) {
    84             add_action( "admin_head-$page", $this->admin_header_callback, 51 );
     84            add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
    8585        }
    8686    }
  • trunk/src/wp-admin/includes/class-wp-themes-list-table.php

    r45583 r45881  
    205205
    206206            /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
    207             $actions       = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, 'all' );
     207            $actions       = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, 'all' );
    208208            $delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
    209209            unset( $actions['delete'] );
  • trunk/src/wp-admin/includes/template.php

    r45873 r45881  
    19591959
    19601960    /** This action is documented in wp-admin/admin-header.php */
    1961     do_action( "admin_print_styles-$hook_suffix" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     1961    do_action( "admin_print_styles-{$hook_suffix}" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    19621962
    19631963    /** This action is documented in wp-admin/admin-header.php */
     
    19651965
    19661966    /** This action is documented in wp-admin/admin-header.php */
    1967     do_action( "admin_print_scripts-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     1967    do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    19681968
    19691969    /** This action is documented in wp-admin/admin-header.php */
     
    19711971
    19721972    /** This action is documented in wp-admin/admin-header.php */
    1973     do_action( "admin_head-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     1973    do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    19741974
    19751975    /** This action is documented in wp-admin/admin-header.php */
     
    20282028
    20292029    /** This action is documented in wp-admin/admin-footer.php */
    2030     do_action( "admin_print_footer_scripts-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     2030    do_action( "admin_print_footer_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    20312031
    20322032    /** This action is documented in wp-admin/admin-footer.php */
  • trunk/src/wp-admin/includes/update.php

    r45599 r45881  
    358358        $plugins = array_keys( $plugins->response );
    359359        foreach ( $plugins as $plugin_file ) {
    360             add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
     360            add_action( "after_plugin_row_{$plugin_file}", 'wp_plugin_update_row', 10, 2 );
    361361        }
    362362    }
     
    546546
    547547        foreach ( $themes as $theme ) {
    548             add_action( "after_theme_row_$theme", 'wp_theme_update_row', 10, 2 );
     548            add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 );
    549549        }
    550550    }
  • trunk/src/wp-content/themes/twentyeleven/inc/theme-options.php

    r45768 r45881  
    104104    }
    105105
    106     add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
     106    add_action( "load-{$theme_page}", 'twentyeleven_theme_options_help' );
    107107}
    108108add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
Note: See TracChangeset for help on using the changeset viewer.