• When I assign pages in the Ultimate Member settings (User, Login, Register etc) it seems to stop WordPress adding <p> tags via the wpautop function?

    If I remove the page association in UM settings it fixes the problem and <p> tags are rendered again.

    https://pmrafnsassociation-co-uk.stackstaging.com/register/

    You’ll notice the lack of paragraph tags in the main content area and the sidebar, but if you go to other pages on the site (that aren’t declared in UM settings) they are adding <p> tags as normal. Any idea what would be causing this?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jhumphries82,

    Have you tried to test this issue on the default WordPress theme?
    Do you use any custom page editor e.g. Visual composer, Divi builder etc?

    Regards.

    Thread Starter jhumphries82

    (@jhumphries82)

    Thanks for the reply ??

    I haven’t tested it on the default theme, but I’m not using any other plugins and I’m using a very basic clean https://underscores.me/ theme that I’ve tweaked myself. I’m certainly not using any visual/page editors – just the default WordPress editor. Is it perhaps something hidden away in Underscore themes causing the problem?

    Thanks
    Julian

    Thread Starter jhumphries82

    (@jhumphries82)

    Hi,

    Further to my previous post, I’ve now reinstalled the default Twenty Seventeen theme and the problem persists. See screenshot:

    https://snag.gy/5z1EiX.jpg

    Looks like it must be a UM bug? I’ve disabled all other plugins and am running the latest version of WordPress.

    Thanks
    Julian

    Thread Starter jhumphries82

    (@jhumphries82)

    Right, I’ve managed to get to the bottom of this myself and thought I should share in case anyone else encounters similar problems…

    I found this code in the UM plugin that clear as day shows why I’m experiencing this problem:

    ultimate-member/includes/core/class-shortcodes.php:
      203  		function is_um_page() {
      204  			if ( is_ultimatemember() ) {
      205 				remove_filter( 'the_content', 'wpautop' );
      206  			}
      207  		}

    I assume there is a good reason for removing the filter but obviously I don’t want it to affect other areas of the page (i.e. my sidebar) so I added the following before my sidebar content:

    if ( is_ultimatemember() ) { add_filter( 'the_content', 'wpautop' ); }

    and then after my sidebar content:

    if ( is_ultimatemember() ) { remove_filter( 'the_content', 'wpautop' ); }

    Problem solved!

    I also encountered the exact same problem with bbPress (which helped me find the above solution) and this post was my saviour:

    https://bbpress.org/forums/topic/the_content-filter-is-removed-by-not-restored-on-custom-wp_query/

    So I just called bbp_restore_all_filters('the_content',0); before my sidebar and then bbp_remove_all_filters(); afterwards. Simples ??

    • This reply was modified 6 years, 4 months ago by jhumphries82.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Assigning pages in UM Settings seems to break wpautop function?’ is closed to new replies.