Simple Membership Plugin › Forums › Simple Membership Plugin › Replace "Profile" with "My Account" in mini login
Tagged: mini login
- This topic has 13 replies, 5 voices, and was last updated 6 years, 1 month ago by
quick_dry.
-
AuthorPosts
-
April 28, 2019 at 7:01 pm #18025
Seb
ParticipantHow can I change “Profile” to “My account” and link it to custom page please?
April 29, 2019 at 2:28 am #18032mbrsolution
ModeratorHi, can you provide more information.
Thank you
April 29, 2019 at 4:16 pm #18038Seb
ParticipantSo after a member logins, mini login bar has two options available: profile and logout. I would like to remove “profile” and replace it with My Account words and link it to “my account” custom page.
Or if you can just tell me in which file I can access php code for the shortcode of mini login bar so I can try change it.
Thanks you.
April 30, 2019 at 5:52 am #18044mbrsolution
ModeratorHi, please check the following documentation. Let me know if this helps you.
Thank you
April 30, 2019 at 9:50 am #18050Seb
ParticipantMini login widget has shortcode: [swpm_mini_login]
(first heading in this article)
I want to modify it. Can You tell me where I can find the code? In which file? I want to remove “Profile” and replace it with “My Account”.
April 30, 2019 at 9:58 pm #18057mbrsolution
ModeratorHi, here is the file you need to check. Please be careful making changes to the core file. They could break the plugins functionality. Also remember that every time you update the plugin your custom code will be lost. It would be a good idea to save a copy of the file locally.
/wp-content/plugins/simple-membership/classes/shortcode-related/class.swpm-shortcodes-handler.phpKind regards
May 1, 2019 at 5:21 pm #18074Seb
ParticipantThank you. This is exactly was I was looking for. Now I am not sure if I can ask my next question here. I do not know how to link url to the last piece of code where it says “(profile-page-url)”
$account_page_url = SwpmSettings::get_instance()->get_value(‘profile-page-url’);
So maybe you could tell me how to change this value so user will be taken to other page instead of profile page.
Thank you in advance.
May 1, 2019 at 11:58 pm #18086mbrsolution
ModeratorHi, I am not a developer myself. Your changes require a customized modification to the plugin’s code. Please remember, if you change the base code, you must ensure that whenever the plugin is updated by WordPress; that you remember to “redo” your modifications.
SWPM is “Open Source” code. If you are a proficient PHP programmer which I think you are, you are welcome to make your own modifications. Alternatively, you can complete a Paid Support request and an SWPM developer will work with you directly.
Kind regards
January 10, 2020 at 6:16 am #19589Mickael
ParticipantHi is there a way to put an edited copy of this page in my theme ?
something like wp-content/themes/<your-theme>/simple-membership/class.swpm-shortcodes-handler.php
thanks
January 10, 2020 at 7:09 am #19591mbrsolution
ModeratorHi, are you talking about adding a copy of your customized php files in your child theme?
January 11, 2020 at 11:38 am #19597Mickael
ParticipantExactly, I have tested directly in wp-content/themes/<your-theme>/simple-membership/class.swpm-shortcodes-handler.php, but doesen’t work ?
January 11, 2020 at 11:07 pm #19598mbrsolution
ModeratorHi,
Thank you for replying back.
Hi is there a way to put an edited copy of this page in my theme ?
I still don’t understand what you mean by the question above? Can you please provide more information.
Thank you
January 12, 2020 at 3:59 pm #19604The Assurer
Moderator@Mackael:
Hi is there a way to put an edited copy of this page in my theme? something like
wp-content/themes/<your-theme>/simple-membership/class.swpm-shortcodes-handler.php@Mbrsolution:
Hi, are you talking about adding a copy of your customized php files in your child theme?@Mackael:
Exactly…You can’t easily “crossbreed” PHP classes from plugins, with themes; because the sequence in which the files are loaded may vary. Your support request is outside the scope of the free support forum; and requires a custom coding job, via our Paid Support service.
March 3, 2020 at 4:46 pm #19864quick_dry
Participant@Mickael instead of messing with your theme, you could put it in a plugin specific to your site – just follow a “build a simple plugin” and put something like this in it – you can see how it checks and modifies the swpm_login_form shortcode’s output. Just call it with the ‘mod_swpm_login_form’ shortcode instead of swpm_login_form.
//Replace the [swpm_login_form] shortcode output with something else //e.g. remove the username from the form output when logged in function shortcode_mod_swpm_login_form(){$output=do_shortcode(‘[swpm_login_form]’);
if (strpos($output,’Logged in as’)>-1){ //if user is logged in
$output=str_replace(‘>Logged in as</div>’,’>Logged in</div>’,$output);
$output=preg_replace(‘/\<div class=\”swpm-logged-username-value swpm-logged-value\”\>(\S+)\<\/div\>/U’, ”, $output);
}
return $output;
}
add_shortcode(‘mod_swpm_login_form’, ‘shortcode_mod_swpm_login_form’);` -
AuthorPosts
- You must be logged in to reply to this topic.