Replies
Hello Julia,
Yes, It is good to have like that. But it is not feasible for “edit profile” in current BuddyPress eco system. It can be doable for other subnav menu like “change-avatar”, “change-cover”.
Thank You
RaviHello Daniel,
Yes, It was a bug with “BuddyBlog” plugin. I have updated the plugin. Please download the latest version of the plugin. You can download the plugin from the following url
https://buddydev.com/plugins/buddyblog/
Thank You
RaviHello Daniel,
Let me check if there is any issue with the plugin and I will let you know when done.
Regards
Ravi- Ravi on March 28, 2018 at 2:04 am in reply to: BuddyPress Featured Members – Slider view not displaying #14130
Hello Aaron,
Thank You for posting. No there is no need to add additional slider plugin. Plugin already have the slider. But it seems there is any javascript error occuring which causing the problem. You can find the javascript error under developer tool > console tab. Please check and let me know.
Thank You
Ravi Hello Daniel,
Good to know that you have found categories ids by your own. For validating featured image replace the previous code for validating categories with the following code.
function buddydev_validate_form( $error, $post ) { if ( ! function_exists( 'buddyblog_get_option' ) ) { return $error; } $error_message = ''; if ( buddyblog_get_option( 'enable_taxonomy' ) ) { $term_count = ( isset( $post['tax_input'] ) ) ? count( $post['tax_input']['category'] ) : 0; // I'm assuming you are refering only post category. if ( empty( $term_count ) ) { $error_message = __( 'Please select one category' ); } elseif ( $term_count > 1 ) { $error_message = __( 'Please select only one category' ); } if ( ! empty( $error_message ) ) { return array( 'error' => true, 'message' => $error_message, ); } } if ( $post['_thumbnail_id'] == -1 ) { return array( 'error' => true, 'message' => __( 'Featured image is required' ), ); } return $error; } add_filter( 'bsfep_validate_post', 'buddydev_validate_form', 10 , 2 );
And let me know if works or not.
Thank you
Ravi- Ravi on March 26, 2018 at 1:24 pm in reply to: [Resolved] Hide the Tab "New Post" in BuddyBlog Plugin #14109
Hello Daniel,
Thank you for the acknowledgement. I am glad I could help.
Thank You
Ravi - Ravi on March 26, 2018 at 1:42 am in reply to: [Resolved] Hide the Tab "New Post" in BuddyBlog Plugin #14100
Hello Daniel,
Replace the previous code with the following code. It will only show tab on edit post screen.
function buddydev_remove_new_post_tab() { if( ! buddyblog_is_edit_post() ) { bp_core_remove_subnav_item( buddypress()->buddyblog->slug, 'edit' ); } } add_action( 'bp_buddyblog_setup_nav', 'buddydev_remove_new_post_tab' ); function buddydev_remove_admin_new_post_tab( $wp_admin_nav_items ) { if ( ! buddyblog_is_edit_post() ) { $new_admin_items = array(); foreach ( $wp_admin_nav_items as $wp_admin_nav_item ) { if ( $wp_admin_nav_item['id'] == 'my-account-' . buddypress()->buddyblog->id . '-new-post' ) { continue; } $new_admin_items[] = $wp_admin_nav_item; } return $new_admin_items; } return $wp_admin_nav_items; } add_filter( 'bp_buddyblog_admin_nav', 'buddydev_remove_admin_new_post_tab' );
And let me know if it works or not.
Regards
Ravi Hello Daniel,
Just use the following code to show only selected categories on post new form.
function buddydev_include_categories( $settings ) { if ( ! isset( $settings['tax'] ) || ! isset( $settings['tax']['category'] ) ) { return $settings; } $settings['tax']['category']['include'] = array( 77, 75 ); // Replace with comma separated list of categories ids you want to include. return $settings; } add_filter( 'buddyblog_post_form_settings', 'buddydev_include_categories' );
and let me know if it works or not.
Regards
RaviHello Daniel,
I have updated the plugin. please download the latest version of “BP Simple Frontend Post” plugin. you can download from the following url
https://buddydev.com/plugins/bp-simple-front-end-post/
and use the following code to prevent user to select only one category.
function buddydev_validate_form( $error, $post ) { if ( ! function_exists( 'buddyblog_get_option' ) || ! buddyblog_get_option( 'enable_taxonomy' ) ) { return $error; } $error_message = ''; $term_count = ( isset( $post['tax_input'] ) ) ? count( $post['tax_input']['category'] ) : 0; // I'm assuming you are refering only post category. if ( empty( $term_count ) ) { $error_message = __( 'Please select one category' ); } elseif ( $term_count > 1 ) { $error_message = __( 'Please select only one category' ); } if ( ! empty( $error_message ) ) { return array( 'error' => true, 'message' => $error_message, ); } return $error; } add_filter( 'bsfep_validate_post', 'buddydev_validate_form', 10 , 2 );
let me know if it works or not
Thank You
Ravi- Ravi on March 23, 2018 at 3:43 pm in reply to: [Resolved] Hide the Tab "New Post" in BuddyBlog Plugin #14065
Hello Daniel,
Thank you for the clarification seems you have not included “<?php” tag. Just remove the old code and paste the following code into that file
<?php function buddydev_remove_new_post_tab() { bp_core_remove_subnav_item( buddypress()->buddyblog->slug, 'edit' ); } add_action( 'bp_buddyblog_setup_nav', 'buddydev_remove_new_post_tab' ); function buddydev_remove_admin_new_post_tab( $wp_admin_nav_items ) { $new_admin_items = array(); foreach ( $wp_admin_nav_items as $wp_admin_nav_item ) { if ( $wp_admin_nav_item['id'] == 'my-account-' . buddypress()->buddyblog->id . '-new-post' ) { continue; } $new_admin_items[] = $wp_admin_nav_item; } return $new_admin_items; } add_filter( 'bp_buddyblog_admin_nav', 'buddydev_remove_admin_new_post_tab' );
and let me know if it works or not
Thank You
Ravi