Support » Developing with WordPress » Disable emoji on specific page?

  • Based on wp-rocket script, i’ve this codeblock:

    add_action( 'init', '__custom_disable_emoji', 1 );
    function __custom_disable_emoji()
    	remove_action( 'wp_head'				, 'print_emoji_detection_script', 7 );
    	remove_action( 'admin_print_scripts'	, 'print_emoji_detection_script' );	
    	remove_filter( 'the_content_feed'		, 'wp_staticize_emoji' );
    	remove_filter( 'comment_text_rss'		, 'wp_staticize_emoji' );	
    	remove_filter( 'wp_mail'				, 'wp_staticize_emoji_for_email' );

    but i cannot make this work-able just for specific page id (i’ll try via function php, plugin, directly in php in page, but nothing seems to work! i can disable for entire blog, or nothing).

    someone can help me on this?
    i glad to maintain emoji for article, but i cannot maintain for some page/script (especially inside pre-syntax codeblock).


Viewing 1 replies (of 1 total)
  • Bunty


    Add one more line to your function for particular page.
    Here is the line : remove_filter( 'the_content', 'convert_smilies', 20 );

Viewing 1 replies (of 1 total)
  • The topic ‘Disable emoji on specific page?’ is closed to new replies.