Filter hook 'print_footer_scripts'

in WP Core File wp-includes/script-loader.php at line 2182

View Source

print_footer_scripts

Filter Hook
Description
Filters whether to print the footer scripts.

Hook Information

File Location wp-includes/script-loader.php View on GitHub
Hook Type Filter
Line Number 2182

Hook Parameters

Type Name Description
bool $print Whether to print the footer scripts. Default true.

Usage Examples

Basic Usage
<?php
// Hook into print_footer_scripts
add_filter('print_footer_scripts', 'my_custom_filter', 10, 1);

function my_custom_filter($print) {
    // Your custom filtering logic here
    return $print;
}

Source Code Context

wp-includes/script-loader.php:2182 - How this hook is used in WordPress core
<?php
2177  	 *
2178  	 * @since 2.8.0
2179  	 *
2180  	 * @param bool $print Whether to print the footer scripts. Default true.
2181  	 */
2182  	if ( apply_filters( 'print_footer_scripts', true ) ) {
2183  		_print_scripts();
2184  	}
2185  
2186  	$wp_scripts->reset();
2187  	return $wp_scripts->done;

PHP Documentation

<?php
/**
	 * Filters whether to print the footer scripts.
	 *
	 * @since 2.8.0
	 *
	 * @param bool $print Whether to print the footer scripts. Default true.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/script-loader.php
Related Hooks

Related hooks will be displayed here in future updates.