print_head_scripts
Filter HookDescription
Filters whether to print the head scripts.Hook Information
File Location |
wp-includes/script-loader.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2147 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$print
|
Whether to print the head scripts. Default true. |
Usage Examples
Basic Usage
<?php
// Hook into print_head_scripts
add_filter('print_head_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:2147
- How this hook is used in WordPress core
<?php
2142 *
2143 * @since 2.8.0
2144 *
2145 * @param bool $print Whether to print the head scripts. Default true.
2146 */
2147 if ( apply_filters( 'print_head_scripts', true ) ) {
2148 _print_scripts();
2149 }
2150
2151 $wp_scripts->reset();
2152 return $wp_scripts->done;
PHP Documentation
<?php
/**
* Filters whether to print the head scripts.
*
* @since 2.8.0
*
* @param bool $print Whether to print the head 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.