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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38504 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2016-09-01 23:59:59 +00:00
parent 770a150b42
commit 5b85aa163f
2 changed files with 54 additions and 0 deletions
+12
View File
@@ -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;
}