Posted: June 19, 2013 at 6:20 pm
|
Hi, Looking to only make a few minor changes to the form found in the user profile with the Members addon. For example, change or remove the title “Events Profile Information” or change “city/town/village” to simply just “City”. I found the form in the module, but I don’t want to hack the module for such simple changes. Is there a way to make a template of the form for the theme folder??? Or make these changes with the theme’s functions.php or something?? It would be ideal if I could have this as a template in the themes folder, so I could make any changes to the form without any hacking. Possible? Thank You! |
Hi Cam, This is something you can change by using the WordPress gettext filter. Basically you can copy and paste a function like this in your WordPress theme’s functions.php file: function mycustom_filter_gettext( $translated, $original, $domain ) { // This is an array of original strings // and what they should be replaced with $strings = array( 'Events Profile Information' => 'Additional Information', 'City/Town/Village' => 'City', 'Please enter your City/Town/Village.' => 'Please enter your City.' // You can add some more strings here ); // See if the current string is in the $strings array // If so, replace it's translation if ( isset( $strings[$original] ) ) { // This accomplishes the same thing as __() // but without running it through the filter again $translations = &get_translations_for_domain( $domain ); $translated = $translations->translate( $strings[$original] ); } return $translated; } add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 ); |
|
|
Great! This worked… Is there a way to “unset” the country field in the functions.php so it doesn’t show up? This isn’t super important, but I don’t really need the field. If there is not a way…..no problem. I would suggest, as a future feature, to make this form into a template. It would make it easier to style the form and making these types of changes for those placing it on the front end instead of in the WordPress Dashboard (like I am doing). Thanks for your help! |
Hi Cam, You can modify all this at will by using the WordPress remove_action and add_actions. I put up a gist that outlines exactly how to remove the country field and add an additional CSS class for styling the form template. You can copy/paste this into your theme’s functions.php file. It adds some sanitization to the input fields too. |
|
|
Perfect!!! Exactly what I was looking for and to accomplish. This helps a bunch. Thanks again for your help! |
The support post ‘Customize Profile (Memebers) Form? (Minor Changes)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.