BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BuddyBlog Pro – override Submit Post for Review #49101

    Hello Nick,

    Please try the following code:

    
    
    /**
     * Skip notification on post submit
     *
     * @param null    $skip_notify  Need to notify or not.
     * @param WP_Post $post         Post object.
     * @param int     $form_id      Form id.
     *
     * @return mixed
     */
    function buddydev_skip_post_submit_notification( $skip_notify, $post, $form_id ) {
    
    	if ( 'publish' === bblpro_get_default_post_status_for_user( get_current_user_id(), $form_id, $post->ID ) ) {
    		$skip_notify = true;
    	}
    
    	return $skip_notify;
    }
    add_filter( 'bblpro_pre_handle_post_submission_admin_notification', 'buddydev_skip_post_submit_notification', 10, 3 );
    add_filter( 'bblpro_pre_handle_post_submission_author_notification', 'buddydev_skip_post_submit_notification', 10, 3 );
    
    

    Please do let me know if it works or not.

    Regard
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Shortcode for Buddyblog #49100

    Hello Van,

    Thank you for the acknowledgment. Is your category seeing on user posting form?. Please check the following link:

    https://tinyurl.com/2hsdd8yz

    Also, Make sure your code is same as the following one.

    
    add_filter( 'buddyblog_post_form_settings', 'buddyblog_show_custom_cats', 100 );
    
    function buddyblog_show_custom_cats( $settings ) {
    	$tax = array();
    
    	$tax['category'] = array(
    		'taxonomy'		=> 'category',
    		'view_type'		=> 'checkbox',
    		'include'		=> array( 31 ), //Your category id,
    		'orderby'		=> 'slug',
    		'order'			=> 'ASC'
    	);
    
    	$settings['tax'] = $tax;
    
    	return $settings;
    }
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Activity Shortcode Tweaks #49060

    Hello Simon

    We have released an update for plugin ‘BuddyPress Community Activity On Profile’ for BuddyBoss platform.
    Please upgrade and give it a try.

    You can download the latest version using following link:

    https://buddydev.com/downloads/bp-community-activity-on-profile/versions/bp-community-activity-on-profile-1-0-6.zip

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BuddyPress Editable Activity UTF-8 #49056

    Hello Tomas,

    We have fixed the UTF-8 issue. Please upgrade the plugin and give it a try.

    Note: Please make sure to refresh browser cache or try in incognito mode.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Restrict upload to own gallery #48994

    Hello Sergio,

    Thank you for the acknowledgement. I am glad to help you.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Restrict upload to own gallery #48992

    Hello Sergio,

    Thank you for the posting. Please use the following code:

    
    add_filter( 'mpp_user_can_upload', function ( $can_do, $component, $component_id, $gallery ) {
    
    	// Only allow uploads to the user's own galleries.
    	if ( 'groups' === $component && get_current_user_id() != $gallery->user_id ) {
    		$can_do = false;
    	}
    
    	return $can_do;
    }, 10, 4 );
    

    Please let me know if it helps or not.

    You can use this code in your active theme “functions.php” file or “bp-custom.php” file.

    If you do not know what is bp-custom.php file. Look at the following link:
    https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

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

    Hello Tosin,

    Please upgrade your plugin and then give it a try. Shortcode e.q. [bp-featured-members enable_type=1 type=newest]

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BuddyBlog Pro – override Submit Post for Review #48344

    Hello Nik,

    Thank you for the acknowledgment. I will check this and will let you know.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BuddyBlog Pro – override Submit Post for Review #48306

    Hello Nik,

    Please replace the old code with the following one:

    
    
    /**
     * Retrieves skipped roles
     *
     * @return string[]
     */
    function bblpro_custom_get_skipped_roles() {
    	return array( 'administrator', 'editor' );
    }
    
    add_filter( 'bblpro_form_post_status', function ( $post_status, $form_id ) {
    
    	if ( ! is_user_logged_in() ) {
    		return $post_status;
    	}
    
    	$form_type = bblpro_get_form_type( $form_id, 'members' );
    
    	if ( 'members' == $form_type && doing_action( 'wp_ajax_bblpro_submit_post' ) ) {
    		// Will always be published if having skipped roles.
    		if ( bblpro_user_has_role_in( get_current_user_id(), bblpro_custom_get_skipped_roles() ) ) {
    			$post_status = 'publish';
    		}
    	}
    
    	return $post_status;
    }, 10, 2 );
    
    add_filter( 'bblpro_submit_button_label', function ( $label, $form ) {
    
    	if ( ! bblpro_user_has_role_in( get_current_user_id(), bblpro_custom_get_skipped_roles() ) ) {
    		return $label;
    	}
    
    	if ( bblpro_is_edit_page() ) {
    		$post_id = bblpro_get_current_editable_post_id();
    
    		if ( 'publish' !== get_post_status( $post_id ) ) {
    			$label = _x( 'Publish', 'Post submission button label', 'buddyblog-pro' );
    		}
    	} elseif ( 'pending' == bblpro_form_get_post_status( $form->ID ) ) {
    		// On create post form.
    		$label = _x( 'Publish', 'Post submission button label', 'buddyblog-pro' );
    	}
    
    	return $label;
    }, 10, 2 );
    
    

    Please give it a try now.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: User Testimonials #48305

    Hello John,

    Please use the following code to add a button to write a testimonial link:

    
    
    add_action( 'bp_member_header_actions', function () {
    
    	if ( ! function_exists( 'tesimonial_current_user_can_write' ) || ! tesimonial_current_user_can_write() ) {
    		return;
    	}
    
    	$displayed_user_id = bp_displayed_user_id();
    
    	if ( ! bp_testimonials_is_enabled_for_user( $displayed_user_id ) ) {
    		return;
    	}
    
    	$link = trailingslashit( bp_displayed_user_domain() . BP_TESTIMONIALS_SLUG );
    
    	$button_args = array(
    		'id'                => 'user-testimonial',
    		'component'         => 'testimonials',
    		'must_be_logged_in' => true,
    		'block_self'        => true,
    		'wrapper_id'        => 'testimonial-button-' . $displayed_user_id,
    		'link_href'         => $link,
    		'link_text'         => __( 'Write Testimonial' ),
    		'link_title'        => __( 'Write Testimonial' ),
    		'link_id'           => 'testimonial-' . $displayed_user_id,
    	);
    
    	if ( function_exists( 'bp_nouveau' ) && ! defined( 'BP_PLATFORM_VERSION' ) ) {
    		$button_args['parent_element'] = 'li';
    	}
    
    	echo bp_get_button( $button_args );
    } );
    
    

    Please give it a try and let me know

    Regards
    Ravi