remove empty paragraphs from the_content?

Hey guys, I simply want to prevent the creation of empty paragraphs in my wordpress post. That happens quite often when trying to manually space content. I don’t know why this doesn’t take effect? /*Remove empty paragraph tags from the_content*/ function removeEmptyParagraphs($content) { /*$pattern = “/<p[^>]*><\\/p[^>]*>/”; $content = preg_replace($pattern, ”, $content);*/ $content = str_replace(“<p></p>”,””,$content); return … Read more

Passing a parameter to filter and action functions

Is a way to pass my own parameters to the function in add_filter or add_action. For example take a look in the following code: function my_content($content, $my_param) { do something… using $my_param here … return $content; } add_filter(‘the_content’, ‘my_content’, 10, 1); Can I pass my own parameter? something like: add_filter(‘the_content’, ‘my_content($my_param)’, 10, 1) or add_filter(‘the_content’, … Read more

Disable emojicons introduced with WP 4.2

So WP 4.2 introduced emojis (smileys) that basically adds JS and other junk all over your pages. Something some people may find shocking. How does one completely erase all instances of this? We will hook into init and remove actions as followed: function disable_wp_emojicons() { // all actions related to emojis remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); … Read more