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™

Tips to customize Member Profile Modification page

s2Member Plugin. A Membership plugin for WordPress®.

Tips to customize Member Profile Modification page

Postby toddz88 » May 14th, 2011, 3:12 pm

I have a page that uses the shortcode [s2Member-Profile /] to display the Member Profile Modification panel, and wanted to customize it in two ways. I'm just sharing in case it helps others.

1) HIDE CERTAIN ROWS
Since the username is not an editable value, I don't want to show it as a disabled input field, which could confuse a user. I am displaying it simply as text elsewhere on the page, above the shortcode, using php to get the value. To hide the Username row, I looked at s2member/includes/profile.inc.php, and found Action Hooks before and after each TR, so i use those hooks to add html comments around the row i want to hide:

in my mu-plugins/s2-hacks.php:
Code: Select all
add_action('ws_plugin__s2member_during_profile_during_fields_before_username','my_hide_start',10);
function my_hide_start ( $vars = array() ) {
   echo "<!--  \n";
}

add_action('ws_plugin__s2member_during_profile_during_fields_after_username','my_hide_end',10);
function my_hide_end ( $vars = array() ) {
   echo " --> \n";
}


I'd prefer to somehow use the hooks to prevent the php from ever outputting the html in the first place, but couldn't figure out how, since the html is just echo'd out line by line in profile.inc.php.


2) ADJUST WIDTH OF INPUT FIELDS
On the Profile Modification panel (again, from profile.inc.php), the input fields all have a hardcoded width from a style="width:99%;" attribute. I could use CSS to make the container less wide, but that also make the Labels wrap prematurely/unnecessariy (particularly the Password label). So i'm using jQuery (in header.php) to REMOVE that hardcoded style attribute:

Code: Select all
<script type="text/javascript">
   jQuery(document).ready(function() {
      jQuery('form#ws-plugin--s2member-profile input').removeAttr("style");
   });
</script>
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Tips to customize Member Profile Modification page

Postby Cristián Lávaque » May 14th, 2011, 7:56 pm

Very cool! Thanks for sharing them! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests

cron