Can we display the wishlist number on the profile menu like the notification message etc show
So if there are 5 items in wishlist, it could display (5) next to it
@ART-Providers
add_action('wplms_logged_in_top_menu','loggedin_login_panel');
function loggedin_login_panel($loggedin_menu){
global $current_user, $wpdb;
$count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->postmeta} WHERE meta_key = 'wishlist_course'");
$loggedin_menu['custom']=array(
'icon' => 'icon-exclamation', // Grab icon code from here : yoursite.com/wp-content/themes/wplms/css/icons-reference.html
'label' => __('Wishlist'.($count),'vibe'),
'link' => 'http://yoursite.com/members/'.$current_user->user_login.'/profile/change-avatar/'
);
return $loggedin_menu;
}
Check this code and add in wp-admin > Plugins >Editor > Select WPLMS Customizer Plugin > wplms-cusstomizer.php
Thank you. Tried this but this did not seem to work. Could anything be wrong here
@ART-Providers,
That's strange it was working on my localhost.
Don't worry let me debug
Thanks. Also, just to let you know, adding that code had messed up the course creation on our system so can you check that too. We have remove the code to fix it
@ART-Providers,
I don't want to debug the code on your site diectly.
Can you please share cpanel details. So that, I can safely debug the code
P.S. mark your reply as private
We do not have cpanel details. Do you mean FTP details?
@ART_providers,
yes, please then share the FTP details if this corrected code will not work
add_action('wplms_logged_in_top_menu','loggedin_login_panel');
function loggedin_login_panel($loggedin_menu){
global $wpdb;
$user_id = bp_displayed_user_id();
$count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->usermeta} WHERE meta_key = 'wishlist_course' AND user_id = $user_id");
$loggedin_menu['custom']=array(
'icon' => 'icon-heart', // Grab icon code from here : yoursite.com/wp-content/themes/wplms/css/icons-reference.html
'label' => __('Wishlist'.($count),'vibe'),
'link' => 'http://yoursite.com/members/'.$current_user->user_login.'/profile/change-avatar/'
);
return $loggedin_menu;
}
Here is the screenshot:
http://prntscr.com/rpnbyv