Home Forums Plugin Support WP Project Manager Pro Front end add project not working

This topic is: resolved

This topic contains 19 replies, has 2 voices, and was last updated by  Tom 4 years, 11 months ago.

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #20087

    Tom
    Member
    Post count: 29
    This reply has been marked as private.
    #20091

    Tom
    Member
    Post count: 29

    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.

    #20094

    Tom
    Member
    Post count: 29

    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);
    }
    
    #20136

    Nizam Uddin
    Keymaster
    Post count: 670

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

    #20217

    Tom
    Member
    Post count: 29

    You're welcome. Hope it helps others. Sorry for leading you on wild goose chase ๐Ÿ˜‰

Viewing 5 posts - 16 through 20 (of 20 total)

The topic ‘Front end add project not working’ is closed to new replies.