Last active
October 8, 2017 19:36
-
-
Save matrixwd/442ff72d9fcd95a28537e3e73f0136e9 to your computer and use it in GitHub Desktop.
Remove Heading tags from Wordpress WYSIWYG / Tinymce editor based on category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function does just what it says. | |
Input your category in the in_category() | |
Author: Eric Murphy | |
URL: https://www.matrixwebdesigners.com/ | |
REF: https://codex.wordpress.org/Conditional_Tags#A_Category_Page | |
You can also use this for other things like pages, etc.. | |
*/ | |
function remove_wysiwyg_tags_based_on_category($arr){ | |
if ( in_category( 'yourCateory' ) ) { | |
$arr['block_formats'] = 'Paragraph=p;Heading 3=h3;Heading 4=h4'; | |
return $arr; | |
} | |
return $arr; | |
} | |
add_filter('tiny_mce_before_init', 'remove_wysiwyg_tags_based_on_category'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment