Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25471

    Wow, That’s great George.
    Congratulation on the first plugin. All the best 🙂

    Should we mark this topic as resolved now?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471

    Hi PresPhuture,
    Since Ravi seems to be away, I will assist here.,

    Please put the following code in your bp-custom.php

    
    
    /**
     * Only show BuddyBlog tabs if a user is author or above.
     */
    function buddyblog_custom_remove_profile_nav() {
    
    	if ( ! bp_is_user() || user_can( bp_displayed_user_id(), 'publish_posts' ) ) {
    		return;
    	}
    
    	bp_core_remove_nav_item( 'buddyblog' );
    
    }
    
    add_action( 'bp_buddyblog_setup_nav', 'buddyblog_custom_remove_profile_nav' );
    
    /**
     * Remove from adminbar too for BuddyBlog.
     */
    function buddyblog_custom_remove_admin_nav( $nav_items ) {
    
    	if ( ! current_user_can( 'publish_posts' ) ) {
    		$nav_items = array();
    	}
    
    	return $nav_items;
    }
    
    add_filter( 'bp_buddyblog_admin_nav', 'buddyblog_custom_remove_admin_nav' );
    

    You may adjust the capability further if you wnat in future.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471
    Brajesh Singh on in reply to: BuddyPress Extended User Groups Widget #12814

    Hi Cecile,
    Can you please post your modified code on pastebin?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471
    Brajesh Singh on in reply to: BuddyPress Signup Avatar plugin crop problem #12813

    Hi Ecet,
    Welcome to BuddyDev.

    The plugin needs update to work with current version of BuddyPress. We will need some time before we can provide you an update.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471

    Congratulations.
    Please do link me when you push the code 🙂

    About the code:-
    $typenow is fine but it tell you more or less about the editing screen and not exactly about the post type being saved.

    In our case, we were saving 2 entries(1 for custom post and another for gallery post type). For both, the $typenow remained same as the second post(gallery) creation was triggered programatically. Using get_post_type( $post_id) gave us the current post being saved’s post type.

    Hope that clarifies.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471

    Hi George,
    Please try changing this line

    
    
     if ( $typenow == 'buslsite' ) {
    
    

    to

    
     if ( get_post_type( $post_id ) == 'buslsite' ) {
    
    

    That should do it.

  • Keymaster
    (BuddyDev Team)
    Posts: 25471
    Brajesh Singh on in reply to: [Resolved] Recent Visitors For BuddyPress Profile #12808

    You are welcome!

  • Keymaster
    (BuddyDev Team)
    Posts: 25471
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25471
    Brajesh Singh on in reply to: [Resolved] Recent Visitors For BuddyPress Profile #12804

    Hi,
    I knew that would happen, That’s why I said to set some width.

    For example, if you have set the avatar size as 10 in the backend, you should set it as

    
    .buddypress div#item-header .recent-visitors img.avatar {
      width: 10px;
    }
    
    

    Do you wnat the round avatars?

    If yes, you can add this line below the width like

    
    
    .buddypress div#item-header .recent-visitors img.avatar {
      width: 10px;
      border-radius: 50%;
    }
    

    and so on.
    Please let me know what do you want it to look like and I can help with the css.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25471

    Hi George,
    In your code, It seems to me you are using update_post_meta with gallery id.

    You are correct that you should not add custom fields for the post types which were not specific to your own implementation.

    Regards
    Brajesh