Viewing 4 Topics - 16 through 19 (of 19 total)
Author Posts
May 7, 2014 at 10:38 pm 20091
Tom Tom

Resolved!

It was the actual filter itself breaking create project functionality in the frontend plugin. The following filter is recommended by the Inceptio theme developer to remove empty p tags inserted by WordPress. There are other such filters out there so beware adding them. They may clean up empty Ps content but can also break plugins.

————————-

Beware: adding empty p tag strippers, such as below, can break the wp front end plugin.

remove_filter( ‘the_content’, ‘wpautop’ );
add_filter( ‘the_content’, ‘wpautop’ , 99);
add_filter( ‘the_content’, ‘shortcode_unautop’, 100);
add_filter(‘the_content’, ‘inc_shortcode_format’, 101);
if (!function_exists(‘inc_shortcode_format’)) {
function inc_shortcode_format($content)
{
$content = preg_replace(‘/(
)\s*(<)/', '<', $content); $content = preg_replace('/()\s*()\s*(<\/p>)/’, ‘‘, $content);
return $content;
}
}

Thanks for your help on this, Nizam.

May 7, 2014 at 10:49 pm 20094
Tom Tom

I’ll add something to this…many people need the p tag filter or their theme is messed with by the empty Ps inserted by WordPress. I just tried a different filter in functions.php instead of the one above. Fixes empty p tag in theme, doesn’t mess with “+” create project in WP Project Manager Front End plugin:


add_filter('the_content', 'remove_empty_p', 20, 1);
function remove_empty_p($content){
    $content = force_balance_tags($content);
    return preg_replace('#\s*+(<br\s*/*>)?\s*
#i', '', $content);
}
May 8, 2014 at 4:34 pm 20136
Nizam Uddin Nizam Uddin

Great job Tom. Thank you for sharing it with weDevs community..

May 9, 2014 at 9:22 pm 20217
Tom Tom

You’re welcome. Hope it helps others. Sorry for leading you on wild goose chase 😉

Viewing 4 Topics - 16 through 19 (of 19 total)