WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] 2.8 introduces [wpmem_txt][/wpmem_txt] to rendered page (9 posts)

  1. globaltimoto
    Member
    Posted 1 year ago #

    Hello Chad

    2.8 gives me auto excerpts, a great time saver.

    However during this update below the excerpt and following the call to register:

    I see:

    "[wpmem_txt][/wpmem_txt]"

    With the login form appearing below.

    What must I do to remove "[wpmem_txt][/wpmem_txt]" from the rendered page ?

    Or could this be a caching issue ?

    http://wordpress.org/extend/plugins/wp-members/

  2. globaltimoto
    Member
    Posted 1 year ago #

    I use the following for the login:

    <?php
    function my_login_status() {
    	global $user_login;
    	$logout = get_bloginfo('url')."/?a=logout";
    	$login = get_bloginfo('url')."/members/";
    	if (is_user_logged_in()) {
    		$wpmem_login_status = '
    		<p>'.$user_login.' | <a href="'.$logout.'">logout</a></p>';
    	} else {
    		$wpmem_login_status = '
    		<p>not logged in | <a href="'.$login.'">login</a></p>';
    	}
    	return $wpmem_login_status;
    }
    ?>
  3. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    Are you calling the login form with a function call? Or is this in some area outside of what would be the main content area of the page?

    What you are seeing is a shortcode that the plugin puts in on the fly to prevent the WordPress function wpautop function from adding line breaks (with the html <p> tag) to the forms. Rather than just the function off completely (which would be bad form, since that might work for some users but not others - we don't assume), the plugin solves its own problem with a shortcode.

    If you are using the login form function outside of the main content area, then the shortcode would not be parsed and would be rendered on the page.

    So I guess I need a little more detail. Do you have a link to an example?

  4. globaltimoto
    Member
    Posted 1 year ago #

    The current implementation had worked without this issue using wp 3.4.2 and 2.77 of wp-members.

    The code above is placed in functions.php in a child theme of twentyeleven.

    Is that what you needed to know ?

    There is no other usage of code or shortcode related to wp-members other than [wp-members page="register"] and [wp-members page="members-area"] for their respective pages.

    Or have I forgotten something ? It's been so long since I set it up.

  5. Hassan
    Member
    Posted 1 year ago #

    Hey, globaltimoto

    I had this similar issue and Chad suggested I could use the wpmem_login_form filter to get rid of those texts. And it worked!

    See this thread here for more details.

  6. globaltimoto
    Member
    Posted 1 year ago #

    Hi Hassan

    Yes I had read your post prior to posting this one and attempted using the code:

    $form = str_replace( array( '[wpmem_txt]', '[/wpmem_txt]' ), '', $form );

    alas to no avail.

  7. Hassan
    Member
    Posted 1 year ago #

    Hmmm, well that worked for me.

    I'm assuming you didn't use ONLY that line of code, right?
    It should, of course, go in your theme's functions.php inside the filter hook.

    Here is the full code snippet:

    function remove_open_wpmem_txt( $form ) {
    	$form = str_replace( array( '[wpmem_txt]', '[/wpmem_txt]' ), '', $form );
    	return $form;
    }
    add_filter( 'wpmem_login_form', 'remove_open_wpmem_txt' );

    Try it and let me know if it works.

  8. globaltimoto
    Member
    Posted 1 year ago #

    Hello Hassan

    Thank you for pointing that out! I WAS missing some of the code.

    Now it's looking good again.

  9. Hassan
    Member
    Posted 1 year ago #

    Glad to help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.