From cce2ffaed5c8483e440690771f18a7f0ab94b5da Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 2 Sep 2016 00:00:30 +0000 Subject: [PATCH] Smilies: Add the `smilies` filter. This new filter allows the smilies array to be modified with a filter, instead of having to directly access the global. Props mte90, jorbin. Fixes #35905. Built from https://develop.svn.wordpress.org/trunk@38504 git-svn-id: http://core.svn.wordpress.org/trunk@38445 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 12 ++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e3d10601ca..95672f5350 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3342,6 +3342,18 @@ function smilies_init() { ); } + /** + * Filter all the smilies. + * + * This filter must be added before `smilies_init` is run, as + * it is normally only run once to setup the smilies regex. + * + * @since 4.6.0 + * + * @param array $wpsmiliestrans List of the smilies. + */ + $wpsmiliestrans = apply_filters('smilies', $wpsmiliestrans); + if (count($wpsmiliestrans) == 0) { return; } diff --git a/wp-includes/version.php b/wp-includes/version.php index ab4727d201..a40f9e0ad7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38503'; +$wp_version = '4.7-alpha-38504'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.