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: 25394

    Hi Sujee,
    Thank you.

    I am using the following code to register a post type

    
    /**
     * Register post type for User Content.
     */
    function buddydev_register_post_type() {
    	register_post_type( 'bp_user_content', array(
    		'label'    => 'User Content',
    		'labels'   => array( 'name' => 'User Contents' ),
    		'public'   => false,
    		'show_ui'  => true,
    		'supports' => array( 'title', 'editor', 'author', 'custom-fields' )
    	) );
    }
    
    add_action( 'init', 'buddydev_register_post_type' );
    
    

    and the following shortcode

    
    [bp-user-last-post post_type='bp_user_content']
    

    And it is working.
    I am not sure of the issue but I am guessing your issue may have to do with the post type registration.

    Please give it a shot and let me know if this works for you or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Dropdown menu #14707

    You will need someone to do the css for you. I am sorry but our support is limited. You will need to hire someone from upwork or codeable to do it for you.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Simple update "profile privacy plugin" #14706

    Sorry, The plugin is hardcoded and It can not be modified. Sorry about this.

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: reorder sub nav activity and change text #14704

    For changing position, I will suggest using
    https://buddydev.com/plugins/buddypress-user-profile-tabs-creator-pro/

    Or look into the code. I will avoid spending time writing it.

    For others, Please use poedit to translate the strings.

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Error warning. Message + Profile Privacy plugin #14703

    Is it the Profile Privacy and Private Message plugin?

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi Sujee,
    What is the post type name?

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Thank you for the kind words Sujee.

    I am looking forward to assist you and hope that the decision to switch will have a positive impact on your project.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Location of buddypress main nav – sub nav #14690

    Hi Julia,
    I have posted to your other topic. You should not modify the files where this function is declrade.

    Also, the last line of code should be do_action not so_shortcodes.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi Sujee,
    Your assumptions are correct. The best way to solve the issue is to use a custom post type and use the shortcode like

    
    [bp-user-last-post post_type='custom-post-type-name']
    

    That way, The user can publish the post and it won’t get affected.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi Herve,
    My code was not for disabling filter, It was to filter out the activity list and exclude those types.

    Your code for hiding filter is incorrect.

    You will need to use something like this

    
    
    /**
     * Remove activity filters in all context.
     * 
     * @param array $filters filters.
     *
     * @return array
     */
    function buddydev_remove_activity_filters_from_dropdown( $filters ) {
        $hidden = array(
                'friendship_accepted,friendship_created',// yup, use it as single key to hide Friendship.
                'joined_group',
                'new_blog_comment',
        );
    
        foreach ( $hidden as $key ) {
            if( isset( $filters[$key] ) ) {
                unset( $filters[$key]);
            }
        }
    
        return $filters;
    }
    add_filter( 'bp_get_activity_show_filters_options', 'buddydev_remove_activity_filters_from_dropdown' );
    

    Add the keys to hidden and they will be filtered out.

    PS:- I will be helping out with the other topic but need some time on that. Hopefully tomorrow I will be able to rethink on that issue and provide code.

    Regards
    Brajesh