add profile menu item

Home Forums Legacy Support Support queries How-to & Troubleshooting add profile menu item

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #377939
    MeesterGijs
    Spectator
    Hello, Most of my members bought their membership individually. About 20% is bought by schools and so their teachers have classes that they follow. So my question: Is it possible to add a profile menu item here that's ONLY visible for members that are added to a batch/class? Thanks, Gijs
    #378024
    Veronica
    Moderator
    hi can you let us know exactly which URL you want to add there?
    #378040
    MeesterGijs
    Spectator
    https://meestergijs.nl/studenten/USERNAME/groups/
    #378102
    Veronica
    Moderator
    ok we need to check the code for this please ping us for the same
    #378136
    MeesterGijs
    Spectator
    Hi Veronica, any thoughts already?
    #378224
    Veronica
    Moderator
    sharing code in sometime
    #378226
    Veronica
    Moderator
    add_filter('wplms_course_details_widget',function($html,$course_id){
    	$hh = '';
    	$batches =  wplms_get_course_batches($course_id);
    	if(!empty($batches)){
    		foreach ($batches as $key => $b) {
    			if(groups_is_user_member(get_current_user_id(),$b)){
    				$hh = '<a href=".'bp_get_group_permalink(groups_get_group($b)).'">Klasen</a>';
    				$html['batch'] = $hh;
    				break;
    
    			}
    		}
    	}
    	return $html;
    },10,2);
    try this code or give credentials to check this on your site
    #378335
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #378592
    Veronica
    Moderator
    yes right checking the code again
    #378628
    MeesterGijs
    Spectator
    and?
    #378665
    Veronica
    Moderator
    use this:
    add_filter('wplms_course_details_widget',function($html,$course_id){
    	$hh = '';
    	$batches =  wplms_get_course_batches($course_id);
    	if(!empty($batches)){
    		foreach ($batches as $key => $b) {
    			if(groups_is_user_member(get_current_user_id(),$b)){
    				$hh = '<a href="'.bp_get_group_permalink(groups_get_group($b)).'">Klasen</a>';
    				$html['batch'] = $hh;
    				break;
    
    			}
    		}
    	}
    	return $html;
    },10,2);
    #378734
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #379195
    Veronica
    Moderator
    ok please try this one:
    add_filter('wplms_course_details_widget',function($html,$course_id){
    	$hh = '';
    	$batches =  wplms_get_course_batches($course_id);
    	if(!empty($batches)){
    		foreach ($batches as $key => $b) {
    			if(groups_is_user_member(get_current_user_id(),$b)){
    				$hh = '<a href="'.bp_get_group_permalink(groups_get_group($b)).'">Klasen</a>';
    				$html['batch'] = $hh;
    				break;
    
    			}
    		}
    	}
    	return $html;
    },99999,2);
    
    #379428
    MeesterGijs
    Spectator
    I added it to Customizer plugin, but still not added to profile menu: https://imgur.com/a/WqHCrPH
    #379528
    Veronica
    Moderator
    hi MeesterGijs can you share FTP details or Cpanel so i can continue easily as the code should work
Viewing 15 posts - 1 through 15 (of 29 total)
  • The topic ‘add profile menu item’ is closed to new replies.