BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Adding Xprofile fields to Recent Visitors directory? #31153

    Hello Carsten,

    No, It is only for Recent Visitors tab only if you want to use it globally for all tabs just remove the following code.

    
    if ( ! function_exists( 'visitors_is_visitor_scope' ) || ! visitors_is_visitor_scope() ) {
    		return;
    	}
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Hide a member type in Profile Search Forms #31151

    Hello Ramon,

    Thank you for posting. Please let me know do you want to hide some member-types from member type dropdown generated by the Profile search form.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Adding Xprofile fields to Recent Visitors directory? #31150

    Hello Carsten,

    Thank you for acknowledgement. Use the following code to print extra content in Recent Visitors tab

    
    /**
     * Adding extra content to member's directory
     */
    function buddydev_recent_visitors_extra_content() {
    
    	if ( ! function_exists( 'visitors_is_visitor_scope' ) || ! visitors_is_visitor_scope() ) {
    		return;
    	}
    
    	echo "put you content here";
    }
    
    add_action( 'bp_directory_members_item', 'buddydev_recent_visitors_extra_content' );
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Adding Xprofile fields to Recent Visitors directory? #31148

    Hello Carsten,

    Thank you for posting. Are you looking for a way to populate extra data in Member’s directory > Recent Visitor specific tab only?. Plese let me know.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Granmeh,

    I have tested and found a bug in “BuddyPress Avatar Moderator” which was restricting an action.”BuddyPress Profile Completion” plugin use that action to set the meta that is why meta always 1. I have updated both the plugins please download the latest version of “BuddyPress Avatar Moderator” and for “BuddyPress Profile Completion” download from the following URL:

    https://github.com/buddydev/bp-profile-completion

    Please check it and let me know if the issue persists or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Bernard,

    Sorry for the inconvenience. Please share your settings so that I can test it quickly.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: visitor counter #30844

    Hello Ankit,

    Above code provided just a sample code How to add a nav item using code. Please try the following code in your active theme “functions.php” file. It will add a menu with name “Visitors” and count. Please make sure you have enabled “Show a profile tab?” setting.

    
    /**
     * Add visitors link
     *
     * @param string   $items The HTML list content for the menu items.
     * @param stdClass $args  An object containing wp_nav_menu() arguments.
     *
     * @return string
     */
    function add_visitors_link( $items, $args ) {
    
        if ( ! is_user_logged_in() || ! function_exists( 'buddypress' ) || ! function_exists( 'visitors_get_profile_visit_count' ) ) {
            return $items;
        }
    
        $visitors_count = visitors_get_profile_visit_count( bp_loggedin_user_id() );
    
    	$visitors_tab_url = trailingslashit( bp_loggedin_user_domain() . 'visitors' );
    
    	$items .= sprintf( '<li><a href="%s">%s <span>%s</span></a></li>', esc_url( $visitors_tab_url ), __( 'Visitors', 'buddypress' ), $visitors_count );
    
    	return $items;
    }
    
    add_filter( 'wp_nav_menu_items', 'add_visitors_link', 10, 2 );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: visitor counter #30836

    Hello Ankit,

    Try using with code. Check the following code adding a login/logout menu.

    
    function add_login_logout_link($items, $args) {
    	$loginoutlink = wp_loginout('index.php', false);
    	$items .= '<li>'. $loginoutlink .'</li>';
    	return $items;
    }
    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: visitor counter #30834

    Hello Ankit,

    As per replied earlier in #30802. We do not provide any way to have counter there. Sorry, But I can not help you much here

    Regards
    Ravi