diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php
index 2ae86d88f5..5f5464e03f 100644
--- a/src/wp-includes/default-filters.php
+++ b/src/wp-includes/default-filters.php
@@ -130,7 +130,7 @@ add_filter( 'the_title', 'convert_chars' );
add_filter( 'the_title', 'trim' );
add_filter( 'the_content', 'wptexturize' );
-add_filter( 'the_content', 'convert_smilies' );
+add_filter( 'the_content', 'convert_smilies', 20 );
add_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'shortcode_unautop' );
add_filter( 'the_content', 'prepend_attachment' );
diff --git a/tests/phpunit/tests/shortcode.php b/tests/phpunit/tests/shortcode.php
index 9f6a71d960..d28abf1ecd 100644
--- a/tests/phpunit/tests/shortcode.php
+++ b/tests/phpunit/tests/shortcode.php
@@ -4,7 +4,7 @@
*/
class Tests_Shortcode extends WP_UnitTestCase {
- protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url' );
+ protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url', 'img' );
function setUp() {
parent::setUp();
@@ -78,6 +78,16 @@ class Tests_Shortcode extends WP_UnitTestCase {
return 'http://www.wordpress.org/';
}
+ function _shortcode_img( $atts ) {
+ $out = '
$v ) {
+ $out .= " $k=\"$v\"";
+ }
+ $out .= ' />';
+
+ return $out;
+ }
+
function test_noatts() {
do_shortcode('[test-shortcode-tag /]');
$this->assertEquals( '', $this->atts );
@@ -657,4 +667,13 @@ EOF;
$expected = "0 = =https://wordpress.org\n";
$this->assertEquals($expected, $out);
}
+
+ /**
+ * @ticket 36306
+ */
+ function test_smilies_arent_converted() {
+ $out = apply_filters( 'the_content', '[img alt="Hello :-) World"]' );
+ $expected = "
\n";
+ $this->assertEquals( $expected, $out );
+ }
}