Skip to content
Permalink
Browse files

Coding Standards: Dynamic hooks should be named using interpolation n…

…ot concatenation.

Props arena, desrosj.
Fixes #47052.

git-svn-id: https://develop.svn.wordpress.org/trunk@45881 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Aug 22, 2019
1 parent 5a47302 commit 0847b67b132a418cb4aa96c24b7b909a0e8813e6
@@ -67,12 +67,12 @@ public function init() {
return;
}
add_action( "load-$page", array( $this, 'admin_load' ) );
add_action( "load-$page", array( $this, 'take_action' ), 49 );
add_action( "load-$page", array( $this, 'handle_upload' ), 49 );
add_action( "load-{$page}", array( $this, 'admin_load' ) );
add_action( "load-{$page}", array( $this, 'take_action' ), 49 );
add_action( "load-{$page}", array( $this, 'handle_upload' ), 49 );
if ( $this->admin_header_callback ) {
add_action( "admin_head-$page", $this->admin_header_callback, 51 );
add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
}
}
@@ -75,13 +75,13 @@ public function init() {
return;
}
add_action( "admin_print_scripts-$page", array( $this, 'js_includes' ) );
add_action( "admin_print_styles-$page", array( $this, 'css_includes' ) );
add_action( "admin_head-$page", array( $this, 'help' ) );
add_action( "admin_head-$page", array( $this, 'take_action' ), 50 );
add_action( "admin_head-$page", array( $this, 'js' ), 50 );
add_action( "admin_print_scripts-{$page}", array( $this, 'js_includes' ) );
add_action( "admin_print_styles-{$page}", array( $this, 'css_includes' ) );
add_action( "admin_head-{$page}", array( $this, 'help' ) );
add_action( "admin_head-{$page}", array( $this, 'take_action' ), 50 );
add_action( "admin_head-{$page}", array( $this, 'js' ), 50 );
if ( $this->admin_header_callback ) {
add_action( "admin_head-$page", $this->admin_header_callback, 51 );
add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
}
}
@@ -204,7 +204,7 @@ public function display_rows() {
$actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' );
/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
$actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, 'all' );
$actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, 'all' );
$delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
unset( $actions['delete'] );
@@ -1958,19 +1958,19 @@ function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_r
do_action( 'admin_enqueue_scripts', $hook_suffix );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_styles-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_styles' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_scripts-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_scripts' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_head-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
@@ -2027,7 +2027,7 @@ function iframe_footer() {
do_action( 'admin_footer', $hook_suffix );
/** This action is documented in wp-admin/admin-footer.php */
do_action( "admin_print_footer_scripts-$hook_suffix" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
do_action( "admin_print_footer_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );
@@ -357,7 +357,7 @@ function wp_plugin_update_rows() {
if ( isset( $plugins->response ) && is_array( $plugins->response ) ) {
$plugins = array_keys( $plugins->response );
foreach ( $plugins as $plugin_file ) {
add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
add_action( "after_plugin_row_{$plugin_file}", 'wp_plugin_update_row', 10, 2 );
}
}
}
@@ -545,7 +545,7 @@ function wp_theme_update_rows() {
$themes = array_keys( $themes->response );
foreach ( $themes as $theme ) {
add_action( "after_theme_row_$theme", 'wp_theme_update_row', 10, 2 );
add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 );
}
}
}
@@ -103,7 +103,7 @@ function twentyeleven_theme_options_add_page() {
return;
}
add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
add_action( "load-{$theme_page}", 'twentyeleven_theme_options_help' );
}
add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );

0 comments on commit 0847b67

Please sign in to comment.
You can’t perform that action at this time.