Administration: Introduce `admin_print_footer_scripts-$hook_suffix"`, a dynamic version of the `admin_print_footer_scripts` hook.

This is now more consistent with the generic `admin_print_scripts` and the dynamic `admin_print_scripts-$hook_suffix` hooks fired in `wp-admin/admin-header.php`.

Props tfrommen.
Fixes #34334.
Built from https://develop.svn.wordpress.org/trunk@37279


git-svn-id: http://core.svn.wordpress.org/trunk@37245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-04-21 15:17:27 +00:00
parent 31b896d1aa
commit 1bd88850f7
5 changed files with 37 additions and 5 deletions

View File

@ -9,6 +9,11 @@
// don't load directly
if ( !defined('ABSPATH') )
die('-1');
/**
* @global string $hook_suffix
*/
global $hook_suffix;
?>
<div class="clear"></div></div><!-- wpbody-content -->
@ -66,6 +71,19 @@ if ( !defined('ABSPATH') )
*/
do_action( 'admin_footer', '' );
/**
* Prints scripts and data queued for the footer.
*
* The dynamic portion of the hook name, `$hook_suffix`,
* refers to the global hook suffix of the current page.
*
* @since 4.6.0
*
* @global string $hook_suffix
* @param string $hook_suffix The current admin page.
*/
do_action( "admin_print_footer_scripts-$hook_suffix" );
/**
* Prints any scripts and data queued for the footer.
*
@ -76,7 +94,7 @@ do_action( 'admin_print_footer_scripts' );
/**
* Print scripts or data after the default footer scripts.
*
* The dynamic portion of the hook name, `$GLOBALS['hook_suffix']`,
* The dynamic portion of the hook name, `$hook_suffix`,
* refers to the global hook suffix of the current page.
*
* @since 2.8.0
@ -84,7 +102,7 @@ do_action( 'admin_print_footer_scripts' );
* @global string $hook_suffix
* @param string $hook_suffix The current admin page.
*/
do_action( "admin_footer-" . $GLOBALS['hook_suffix'] );
do_action( "admin_footer-$hook_suffix" );
// get_site_option() won't exist when auto upgrading from <= 2.7
if ( function_exists('get_site_option') ) {

View File

@ -1530,6 +1530,9 @@ class WP_Press_This {
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_footer' );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts-press-this.php' );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );

View File

@ -1651,11 +1651,19 @@ function iframe_footer() {
* but run the hooks anyway since they output JavaScript
* or other needed content.
*/
?>
/**
* @global string $hook_suffix
*/
global $hook_suffix;
?>
<div class="hidden">
<?php
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_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" );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );

View File

@ -799,6 +799,9 @@ final class WP_Customize_Widgets {
* @access public
*/
public function print_footer_scripts() {
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts-widgets.php' );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37278';
$wp_version = '4.6-alpha-37279';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.