Make WordPress Core

Changeset 37279


Ignore:
Timestamp:
04/21/2016 03:16:52 PM (8 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src
Files:
4 edited

Legend:

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

    r32642 r37279  
    1010if ( !defined('ABSPATH') )
    1111    die('-1');
     12
     13/**
     14 * @global string $hook_suffix
     15 */
     16global $hook_suffix;
    1217?>
    1318
     
    6873
    6974/**
     75 * Prints scripts and data queued for the footer.
     76 *
     77 * The dynamic portion of the hook name, `$hook_suffix`,
     78 * refers to the global hook suffix of the current page.
     79 *
     80 * @since 4.6.0
     81 *
     82 * @global string $hook_suffix
     83 * @param string $hook_suffix The current admin page.
     84 */
     85do_action( "admin_print_footer_scripts-$hook_suffix" );
     86
     87/**
    7088 * Prints any scripts and data queued for the footer.
    7189 *
     
    7795 * Print scripts or data after the default footer scripts.
    7896 *
    79  * The dynamic portion of the hook name, `$GLOBALS['hook_suffix']`,
     97 * The dynamic portion of the hook name, `$hook_suffix`,
    8098 * refers to the global hook suffix of the current page.
    8199 *
     
    85103 * @param string $hook_suffix The current admin page.
    86104 */
    87 do_action( "admin_footer-" . $GLOBALS['hook_suffix'] );
     105do_action( "admin_footer-$hook_suffix" );
    88106
    89107// get_site_option() won't exist when auto upgrading from <= 2.7
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r36970 r37279  
    15321532
    15331533    /** This action is documented in wp-admin/admin-footer.php */
     1534    do_action( 'admin_print_footer_scripts-press-this.php' );
     1535
     1536    /** This action is documented in wp-admin/admin-footer.php */
    15341537    do_action( 'admin_print_footer_scripts' );
    15351538
  • trunk/src/wp-admin/includes/template.php

    r37231 r37279  
    16521652     * or other needed content.
    16531653     */
    1654      ?>
     1654
     1655    /**
     1656     * @global string $hook_suffix
     1657     */
     1658    global $hook_suffix;
     1659    ?>
    16551660    <div class="hidden">
    16561661<?php
    16571662    /** This action is documented in wp-admin/admin-footer.php */
    1658     do_action( 'admin_footer', '' );
     1663    do_action( 'admin_footer', $hook_suffix );
     1664
     1665    /** This action is documented in wp-admin/admin-footer.php */
     1666    do_action( "admin_print_footer_scripts-$hook_suffix" );
    16591667
    16601668    /** This action is documented in wp-admin/admin-footer.php */
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r37166 r37279  
    801801    public function print_footer_scripts() {
    802802        /** This action is documented in wp-admin/admin-footer.php */
     803        do_action( 'admin_print_footer_scripts-widgets.php' );
     804
     805        /** This action is documented in wp-admin/admin-footer.php */
    803806        do_action( 'admin_print_footer_scripts' );
    804807
Note: See TracChangeset for help on using the changeset viewer.