WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] Remove from displaying [wpmem_txt] [/wpmem_txt] widget (5 posts)

  1. rj10x
    Member
    Posted 1 year ago #

    I`m using final version of WordPress and WP-members plugin.

    When I imput login ang registration form into widget, it also display some tags [wpmem_txt] [/wpmem_txt].

    http://clip2net.com/s/4Xn6Qi

    Please, see screenshot, and help me remove it....

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

  2. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    It seems you are using the body login/registration forms in a sidebar?

    Since those forms aren't intended for that purpose, you may get varying results. That shortcode is something that the plugin puts in on the fly to overcome WP's putting p and br tags into the content. That doesn't happen in the sidebar.

    So you either need to allow shortcodes in your sidebar or use one of the plugin's filters to remove it (see the forms filters in this list)

  3. triplemoons
    Member
    Posted 4 months ago #

    I am unfortunately, experiencing the same problem. Could a specific solution to the problem please be provided by the Plugin Author?

    I attempted the functions file modifications as described here, however the only result was a white screen.

  4. Chad Butler
    Member
    Plugin Author

    Posted 4 months ago #

    Well... that was the specific solution. Unfortunately, in taking a look at it from your link, it appears that the shortcode in the code snippet is being parsed in the page which of course renders the code snippet kind of useless. When it was originally posted, the site was different, so I think something in shift to the new theme might have caused an issue with the code snippet display.

    Anyway, I tried to edit it and seemed to have made the issue worse, so I'll just post the snippet here:

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

    That's what the code snippet is supposed to be.

    However, if you are using the current 2.9 release, I am a little surprised this is an issue. I made some significant changes to the form building functions in this release and one of those changes was to hopefully completely resolve any of these unparsed shortcodes.

    Also if you are using 2.9, there is actually a new and better way to remove this. It's a little more efficient because it doesn't have to use str_replace:

    add_filter( 'wpmem_register_form_args', 'my_form_defaults' );
    function my_form_defaults( $args ) {
    	$args = array(
    		'txt_before' => '[wpmem_txt]',
    		'txt_after'  => '[/wpmem_txt]',
    	);
    	return $args;
    }
  5. triplemoons
    Member
    Posted 4 months ago #

    I am using 2.9, but I'm also using WP 3.8.1, so I'm not sure if that's a factor in why it's being ornery. The first function provided worked, the second did not.

    Thank you bunches!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic