smilies_src
Filter HookDescription
Filters the Smiley image URL before it's used in the image element.Hook Information
File Location |
wp-includes/formatting.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3466 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$smiley_url
|
URL for the smiley image. |
string
|
$img
|
Filename for the smiley image. |
string
|
$site_url
|
Site URL, as returned by site_url(). |
Usage Examples
Basic Usage
<?php
// Hook into smilies_src
add_filter('smilies_src', 'my_custom_filter', 10, 3);
function my_custom_filter($smiley_url, $img, $site_url) {
// Your custom filtering logic here
return $smiley_url;
}
Source Code Context
wp-includes/formatting.php:3466
- How this hook is used in WordPress core
<?php
3461 *
3462 * @param string $smiley_url URL for the smiley image.
3463 * @param string $img Filename for the smiley image.
3464 * @param string $site_url Site URL, as returned by site_url().
3465 */
3466 $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
3467
3468 return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', esc_url( $src_url ), esc_attr( $smiley ) );
3469 }
3470
3471 /**
PHP Documentation
<?php
/**
* Filters the Smiley image URL before it's used in the image element.
*
* @since 2.9.0
*
* @param string $smiley_url URL for the smiley image.
* @param string $img Filename for the smiley image.
* @param string $site_url Site URL, as returned by site_url().
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/formatting.php
Related Hooks
Related hooks will be displayed here in future updates.