Home›Forums›Feature Requests›Volunteer Sign-Up Sheets – Feature Requests›Adding login log out to page instead of message›Reply To: Adding login log out to page instead of message
I would usually recommend that you don’t directly modify the plugin file, as any changes you make will get wiped out if you update the plugin in the future.
Login/Logout would normally be handled the same way you already do for your WordPress site. There are plenty of sidebar widgets you can use for login/logout without going to the regular WordPress login page if you want.
However, if you want to modify the code, you can find that message in the:
class-pta_sus_public.php
file on line 195.
But, if you just wanted to add some login links conditionally without actually modifying the plugin code, note that there is a built-in action hook on line 181 that fires before the shortcode for my plugin is processed.
You could add a script similar to what you just posted into your theme’s functions.php file, and hook into my ‘pta_sus_before_process_shortcode’ action hook, where you can check if the user is logged in or not on your own, and display your own message and login/logout links. Then you can use the option in the settings for my plugin to disable the login notices so that they will only see your notices and not mine.
If you aren’t familiar with how the action hooks work, do a quick internet search and you’ll find plenty of info about them, but basically you add some code into your functions.php file like this:
add_action('pta_sus_before_process_shortcode', 'my_login_function');
function my_login_function {
// do some stuff here - check if they are logged in, echo/return your form/links, etc.
}