Support » Plugin: WP-Members Membership Plugin » Edit ‘begin using site’ link

  • Hi,

    Can I change the link on the ‘begin using site’ text displayed with the registration shortcode when a user is logged in?

Viewing 1 replies (of 1 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    There are several answers to that question (as is often the case for many things in the plugin). It all depends on preference, and what you want to do. This is a fairly detailed answer and I certainly could have given a single, simple option. However, this is as an example of almost every “how do I change {something}” question in this plugin – there are quite a few different ways, some documented, some not; and there is almost always at least one possible example on the support site.

    wpmem_register_links_args or wpmem_register_links

    These two filters allow you to filter the message that is placed. The “_args” filter handles the parts that make up the HTML for that screen as an array, so you can target specific pieces (“register_continue” in this case). The wpmem_register_links filter on the other hand, filters the entire HTML of the display (so you could replace the entire thing all at once). There are lots of these types of filter combinations throughout the plugin, so this example extends to other user facing text as well – just incorporating other filters.

    One thing to note for future development – while I generally attempt to keep things as backward compatible as possible, MOST of the “_args” filters are being deprecated in the upcoming 3.3.0 version and replaced with something more useable. These will use a different stem than “_args”. The filter we’re talking about here does not have the same limitations and fits the new standard. However, it has yet to be determined if it makes sense to make a name change to fit the new standard. So… it is possible this filter MAY be replaced with something else. IF it is, it would still remain in the plugin as-is for AT LEAST a full life cycle (i.e. 3.3.0 to 3.4.0) or longer, and would keep backward compatibility. It would also be announced as deprecated, and then announced when it was removed. NO determination has yet been made, but since the case exists in the dev cycle, it’s worth mentioning here.

    wpmem_default_text_strings and wpmem_default_text

    These filters handle all of the default text. In this case it could be used to filter the “register_continue” text. wpmem_default_text_strings is documented with some examples, but it is deprecated as of 3.2.7. You should use wpmem_default_text instead. It works the same way, but requires that you pass the $text array both in and out of the filter.

    [wpmem_form register] shortcode

    When using the register form shortcode, you can apply an entirely custom logged in state that replaces everything listed above with whatever is nested in the shortcode.

    [wpmem_form register]
    This displays as the logged in state in place of the default.
    You can include whatever links you deem necessary (or not).
    [/wpmem_form]

    Version 3.3.0

    In the upcoming version 3.3.0, the “begin using the site” text will be replaced with “edit profile” IF there is a user profile page set in the plugin’s settings (otherwise it will fall back to the “begin using the site” text if no user profile page is set). (Development repo available on github)

    Redirect to profile page if logged in

    There’s not a specific example of this, but you can use the wpmem_register_url() function to check the current page. If it is the register page AND the user is logged in, you could redirect them to another page (presumably the user profile page, but could be anything).

    Premium option

    If you choose to go with a “premium” option, there are a few different possibilities in addition to the above, most notably the Text Editor extension, which has a direct input for the string mentioned above. It gives you a simple interface to customize all of the user facing text in a single admin panel.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.