PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Remove asterisks (*) from Registration Form

s2Member Plugin. A Membership plugin for WordPress®.

Remove asterisks (*) from Registration Form

Postby PseudoNyhm » September 9th, 2011, 10:11 am

On the registration form, s2Member places asterisks on Username *, Password *, and E-Mail * which is really annoying to me. The reason this annoys me is because:

  1. It is hard-wired into s2Member's logic (but has nothing to do with membership)
  2. It cannot be turned off
  3. It assumes the user knows this implies a required field
  4. It does not account for custom fields that might be in the registration form, which do not get the (*) making the interface inconsistent
  5. It is performed through a translation filter, but is not really a translation issue

Sorry if this comes across as negative. You know I'm a big fan of s2Member, and your coding is top-notch.

I have disabled the behavior by commenting out two lines of code in translations.inc.php. Can you recommend a cleaner way to disable this (maybe via s2-hacks.php)?
User avatar
PseudoNyhm
Experienced User
Experienced User
 
Posts: 79
Joined: June 19, 2011

Re: Remove asterisks (*) from Registration Form

Postby Jason Caldwell » September 12th, 2011, 5:20 pm

Thanks for the feedback, much appreciated.

Well the asterisks do indicate required fields, and while it my be inconsistent on some configurations of Custom Fields, if you wanted to make it consistent with yours, you could add asterisks to the Custom Registration Fields that you configured as "required" indicating it is a required field. To clarify, an asterisk can be added to the Label that you give your Custom Registration Field, under: s2Member -> General Options -> Custom Registration Fields.

That being said, I'll see what we can do about this in a future release. One thing that's coming later today, is support for _x() gettext translations, so you may find the newest release more flexible in this regard.

Excerpt from the coming Changelog in s2Member v110912:
== Translations ==

s2Member and s2Member Pro are now equipped with support for front-end translation, using standardized WordPress® methodologies; i.e. we've implemented the use of `_x()`, and various other translation routines for many aspects of s2Member's front-end interfaces. For instance, things like Profile panels, Login/Registration Fields, and Pro Form integrations; as well as error messages displayed to Users/Members. Translation support for back-end admin panels provided by s2Member will come in a future release, along with more extensive translation support for front-end aspects.

Please note, this is but our first step toward internationalizing s2Member and s2Member Pro. Look for further updates/improvements to come in the future.

Like WordPress® itself, we chose to use the GNU `gettext` localization framework to provide localization infrastructure for s2Member®. GNU `gettext` is a mature, widely used framework for modular translation of software, and is the *de facto* standard for localization in the open source/free software realm. If you'd like to translate s2Member and/or s2Member Pro, please use the POT file found inside `/s2member/includes/translations/s2member.pot`, which contains all translation entries for both the s2Member Framework *( i.e. the free version )*, and also for s2Member Pro.

The file: `/s2member/includes/translations/s2member.pot` will be updated with each new release of s2Member.

If this is your first translation of a WordPress® plugin, this article and/or this article, might be of some assistance. When you are finished translating the `s2member.pot` file, place your completed `s2member-[locale].mo` file into this directory: `/s2member/includes/translations/`; and please feel free to share your translation with the rest of the s2Member® community.

Quick Tip: If you only need to translate the front-end of s2Member, please ignore entries in the `s2member.pot` file with a context matching `s2member-admin`. Those sections of s2Member are only seen by site Administrators; they are NOT used in s2Member's front-end integration with WordPress®. Skipping over translation entries with a context matching `s2member-admin` can save you time.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Remove asterisks (*) from Registration Form

Postby PseudoNyhm » September 12th, 2011, 9:33 pm

Thanks for your reply. I have found a way to implement this without commenting out or editing the core s2member code at all. It was staring me in the face. I added the following to s2-hacks.php:

Code: Select all
add_filter("ws_plugin__s2member_translation_mangler", "custom_translation_mangler");
function custom_translation_mangler($translated, $vars = array())
{
    if ($translated === "Username *")
    {
        $translated = "Username";
    }
    // .. etc
    return $translated;
}


A testament to your attention to detail in the code. Thanks for all the filters.
User avatar
PseudoNyhm
Experienced User
Experienced User
 
Posts: 79
Joined: June 19, 2011

Re: Remove asterisks (*) from Registration Form

Postby Jason Caldwell » September 13th, 2011, 3:06 pm

Awesome. Why didn't I think of that? :-)
Nice work, and thanks for your praise, it's MUCH appreciated.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Remove asterisks (*) from Registration Form

Postby PseudoNyhm » September 13th, 2011, 7:18 pm

Jason Caldwell wrote:Awesome. Why didn't I think of that? :-)


Overworked, obviously! I just upgraded to v20110912 -- sounds like a lot of work went into it (and the upgrade went through without a hitch). I'm going to read your article on efficiency improvements. You deserve a vacation.
User avatar
PseudoNyhm
Experienced User
Experienced User
 
Posts: 79
Joined: June 19, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron