style_loader_src
Filter HookDescription
Filters an enqueued style's fully-qualified URL.Hook Information
File Location |
wp-includes/class-wp-styles.php
View on GitHub
|
Hook Type | Filter |
Line Number | 412 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$src
|
The source URL of the enqueued style. |
string
|
$handle
|
The style's registered handle. |
Usage Examples
Basic Usage
<?php
// Hook into style_loader_src
add_filter('style_loader_src', 'my_custom_filter', 10, 2);
function my_custom_filter($src, $handle) {
// Your custom filtering logic here
return $src;
}
Source Code Context
wp-includes/class-wp-styles.php:412
- How this hook is used in WordPress core
<?php
407 * @since 2.6.0
408 *
409 * @param string $src The source URL of the enqueued style.
410 * @param string $handle The style's registered handle.
411 */
412 $src = apply_filters( 'style_loader_src', $src, $handle );
413 return esc_url( $src );
414 }
415
416 /**
417 * Whether a handle's source is in a default directory.
PHP Documentation
<?php
/**
* Filters an enqueued style's fully-qualified URL.
*
* @since 2.6.0
*
* @param string $src The source URL of the enqueued style.
* @param string $handle The style's registered handle.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/class-wp-styles.php
Related Hooks
Related hooks will be displayed here in future updates.