WordPress filter hook · part of WordPress core

smilies_src

A WordPress core filter that 6 plugins also fire themselves, running on 101K+ sites between them.

“Filter the Smiley image URL before it's used in the image element.”

How to use smilies_src

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'smilies_src', function( $includes_url, $img, $url ) {
	// Change $includes_url here.
	return $includes_url;
}, 10, 3 );

Argument names come from LazyLoad Plugin's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

6 plugins that fire smilies_src

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. LazyLoad Plugin icon LazyLoad Plugin100,000+ installs apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() ) inc/Dependencies/RocketLazyload/Image.php:828
  2. TinyMCE Smiley Button icon TinyMCE Smiley Button500+ installs apply_filters( 'smilies_src', includes_url('images/smilies/'), '', site_url() ) tinymce-smiley-button.php:38
  3. Simple:Press Forum icon Simple:Press Forum300+ installs apply_filters( 'smilies_src', includes_url("images/smilies/$img"), $img, site_url() ) sp-api/sp-api-class-spcdisplayfilters.php:225
  4. HTML entities button icon HTML entities button40+ installs apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() ) html-entities-button.php:545
  5. Stylish Smilies icon Stylish Smilies10+ installs apply_filters( 'smilies_src', includes_url("images/smilies/$img"), $img, site_url() ) main.php:119
  6. Custom Smilies Directory icon Custom Smilies Directory10+ installs apply_filters( 'smilies_src', get_stylesheet_directory_uri() . "/smilies/$img", $img, site_url() ) custom-smilies-directory.php:35

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.