Make WordPress Core

Ticket #27520: 27520.diff

File 27520.diff, 3.4 KB (added by DrewAPicture, 10 years ago)
  • src/wp-includes/script-loader.php

     
    117117
    118118        $scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1 );
    119119        did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings',
     120                /**
     121                 * Filter the Heartbeat settings.
     122                 *
     123                 * @since 3.6.0
     124                 *
     125                 * @param array $settings Heartbeat settings array.
     126                 */
    120127                apply_filters( 'heartbeat_settings', array() )
    121128        );
    122129
    123130        $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 );
    124131        did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array(
    125132                'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'),
     133
     134                /**
     135                 * Filter the authentication check interval.
     136                 *
     137                 * @since 3.6.0
     138                 *
     139                 * @param int $interval The interval in which to check a user's authentication.
     140                 *                      Default 3 minutes in seconds, or 180.
     141                 */
    126142                'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),
    127143        ) );
    128144
     
    761777        $wp_scripts->do_concat = $concatenate_scripts;
    762778        $wp_scripts->do_head_items();
    763779
    764         if ( apply_filters('print_head_scripts', true) )
     780        /**
     781         * Filter whether to print the head scripts.
     782         *
     783         * @since 2.8.0
     784         *
     785         * @param bool $print Whether to print the head scripts. Default true.
     786         */
     787        if ( apply_filters( 'print_head_scripts', true ) ) {
    765788                _print_scripts();
     789        }
    766790
    767791        $wp_scripts->reset();
    768792        return $wp_scripts->done;
     
    783807        $wp_scripts->do_concat = $concatenate_scripts;
    784808        $wp_scripts->do_footer_items();
    785809
    786         if ( apply_filters('print_footer_scripts', true) )
     810        /**
     811         * Filter whether to print the footer scripts.
     812         *
     813         * @since 2.8.0
     814         *
     815         * @param bool $print Whether to print the footer scripts. Default true.
     816         */
     817        if ( apply_filters( 'print_footer_scripts', true ) ) {
    787818                _print_scripts();
     819        }
    788820
    789821        $wp_scripts->reset();
    790822        return $wp_scripts->done;
     
    859891 * @since 2.8.0
    860892 */
    861893function wp_print_footer_scripts() {
    862         do_action('wp_print_footer_scripts');
     894        /**
     895         * Fires when footer scripts are printed.
     896         *
     897         * @since 2.8.0
     898         */
     899        do_action( 'wp_print_footer_scripts' );
    863900}
    864901
    865902/**
     
    871908 * @since 2.8.0
    872909 */
    873910function wp_enqueue_scripts() {
    874         do_action('wp_enqueue_scripts');
     911        /**
     912         * Fires when scripts are enqueued.
     913         *
     914         * @since 2.8.0
     915         */
     916        do_action( 'wp_enqueue_scripts' );
    875917}
    876918
    877919/**
     
    893935
    894936        $wp_styles->do_items(false);
    895937
    896         if ( apply_filters('print_admin_styles', true) )
     938        /**
     939         * Filter whether to print the admin styles.
     940         *
     941         * @since 2.8.0
     942         *
     943         * @param bool $print Whether to print the admin styles. Default true.
     944         */
     945        if ( apply_filters( 'print_admin_styles', true ) ) {
    897946                _print_styles();
     947        }
    898948
    899949        $wp_styles->reset();
    900950        return $wp_styles->done;
     
    914964        $wp_styles->do_concat = $concatenate_scripts;
    915965        $wp_styles->do_footer_items();
    916966
    917         if ( apply_filters('print_late_styles', true) )
     967        /**
     968         * Filter whether to print the styles queued too late for the HTML head.
     969         *
     970         * @since 3.3.0
     971         *
     972         * @param bool $print Whether to print the 'late' styles. Default true.
     973         */
     974        if ( apply_filters( 'print_late_styles', true ) ) {
    918975                _print_styles();
     976        }
    919977
    920978        $wp_styles->reset();
    921979        return $wp_styles->done;