Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › How to remove "view profile" and information below
- This topic has 9 replies, 3 voices, and was last updated 8 years, 11 months ago by deadelfujiama.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
November 13, 2015 at 2:19 pm #8513remySpectatorHello, How to remove all the information below logout? (screenshot attached) Meaning : dashboard, courses, stats, inbox, notifications, setting I would also like to remove "view profile" ThanksNovember 14, 2015 at 1:49 pm #8682Anshuman SahuKeymasterPlease refer for removing links blow username : https://wplms.io/support/knowledge-base/addedit-custom-links-in-the-logged-in-login-panel/ and add the given css to hide the "view profile " . #vibe_bp_login li#username+li>a { text-transform: none; display: none; }November 16, 2015 at 11:01 am #8872remySpectatorMany Thanks. We now have a problem with the code, could you help us to correct it and include your function: NB: We added before functions in order to remove course details.
<?php if(!class_exists('WPLMS_Customizer_Plugin_Class')) { class WPLMS_Customizer_Plugin_Class // We'll use this just to avoid function name conflicts { public function __construct(){ add_filter('wplms_course_details_widget',array($this,'custom_wplms_course_details_widget')); add_filter('wplms_course_details_widget',array($this,'remove_wplms_course_details_widget')); add_filter('wplms_course_nav_menu','wplms_course_remove_nav_section',100); add_filter('wplms_logged_in_top_menu',array($this,'loggedin_login_panel')); function wplms_course_remove_nav_section($sections){ unset($sections['events']); return $sections; } } // END public function __construct public function activate(){ // ADD Custom Code which you want to run when the plugin is activated } public function deactivate(){ // ADD Custom Code which you want to run when the plugin is de-activated } function loggedin_login_panel($loggedin_menu){ unset($loggedin_menu['stats']); // stats, courses, messages, notifications, groups return $loggedin_menu; } function custom_wplms_course_details_widget($course_details){ $key = 'price'; // Set $key value from price,precourse,time,level,seats,badge,certificate unset($course_details[$key]); return $course_details; } function remove_wplms_course_details_widget($course_details){ $key = 'time'; // Set $key value from price,precourse,time,level,seats,badge,certificate unset($course_details[$key]); return $course_details; } } // END class WPLMS_Customizer_Class } // END if(!class_exists('WPLMS_Customizer_Class')) ?>
November 17, 2015 at 7:02 am #9023Anshuman SahuKeymasterI have edited the code please refer to the correct code :<?php if(!class_exists('WPLMS_Customizer_Plugin_Class')) { class WPLMS_Customizer_Plugin_Class // We'll use this just to avoid function name conflicts { public function __construct(){ add_filter('wplms_course_details_widget',array($this,'custom_wplms_course_details_widget')); add_filter('wplms_course_details_widget',array($this,'remove_wplms_course_details_widget')); add_filter('wplms_course_nav_menu',array($this,'wplms_course_remove_nav_section',100)); add_filter('wplms_logged_in_top_menu',array($this,'loggedin_login_panel')); } // END public function __construct public function activate(){ // ADD Custom Code which you want to run when the plugin is activated } public function deactivate(){ // ADD Custom Code which you want to run when the plugin is de-activated } function loggedin_login_panel($loggedin_menu){ unset($loggedin_menu['stats']); // stats, courses, messages, notifications, groups return $loggedin_menu; } function custom_wplms_course_details_widget($course_details){ $key = 'price'; // Set $key value from price,precourse,time,level,seats,badge,certificate unset($course_details[$key]); return $course_details; } function remove_wplms_course_details_widget($course_details){ $key = 'time'; // Set $key value from price,precourse,time,level,seats,badge,certificate unset($course_details[$key]); return $course_details; } function wplms_course_remove_nav_section($sections){ unset($sections['events']); return $sections; } } // END class WPLMS_Customizer_Class } // END if(!class_exists('WPLMS_Customizer_Class')) ?>
November 17, 2015 at 9:08 am #9047remySpectatorThank you the code works, but we have an other problem, to remove the login panel I put this function :function loggedin_login_panel($loggedin_menu){ unset($loggedin_menu['stats']); // stats, courses, messages, notifications, groups return $loggedin_menu; }
But it obviously removes only stats, so I tried to replace 'stats' by 'courses', 'messages' etc., and that didn't work. What can I do to remove courses, messages, notifications, groups? Do I have to change the order, and put courses in first instead of stats? Thanks!!November 18, 2015 at 5:54 am #9224Anshuman SahuKeymasterIf you want to remove multiple nav menus then please try the function like this : function loggedin_login_panel($loggedin_menu){ unset($loggedin_menu['stats']); // stats, courses, messages, notifications, groups unset($loggedin_menu['courses']); unset($loggedin_menu['messages']); unset($loggedin_menu['notifications']); unset($loggedin_menu['groups']); return $loggedin_menu; }November 18, 2015 at 9:35 am #9287remySpectatorThank you! I've done the same thing to remove Dashboard and Settings, but only settings was removed. Can you help me to remove dashboard?November 18, 2015 at 11:29 am #9330deadelfujiamaSpectatorHello, I would do the same thing that asks Remy but I have a problem. when I add the code page returns this error message. How can I fix? <p class="p1"><span class="s1"><b>Fatal </b>error: Can not redeclare WPLMS_Customizer_Plugin_Class :: loggedin_login_panel () in <b>/home/lifelear/public_html/dev/wp-content/plugins/wplms-customizer/classes/customizer_class.php</b> on line <b>417</b></span></p>November 19, 2015 at 11:59 am #9527Anshuman SahuKeymasterTry this code to do that : In the function __constrcut : add_filter('wplms_logged_in_top_menu',array($this,'loggedin_login_panel_new'));outside the __contruct function : function loggedin_login_panel_new($loggedin_menu){
unset($loggedin_menu['stats']); // stats, courses, messages, notifications, groups
unset($loggedin_menu['courses']);
unset($loggedin_menu['messages']);
unset($loggedin_menu['notifications']);
unset($loggedin_menu['groups']);return $loggedin_menu;
}
November 24, 2015 at 4:09 pm #10431deadelfujiamaSpectatorThanks Alex, now works -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘How to remove "view profile" and information below’ is closed to new replies.