BuddyDev

Search

[Resolved] Question about Blog Categories For Groups setting

  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19704

    Hello support team

    I’ve installed this plugin for my buddypress site. When a user creates a group, there is an option to select a Categorie of my site. It show all Categories of the site.

    I’d like to know how to set to allow the group creator to chose only allow a part of Categories.

    Is it possible to do this ?

    Thanks for your answers.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2944
    Ravi on #19706

    Hello Bin,

    Thank you for posting. It can be done easily. Please use the following code in your “bp-custom.php” file and let me know if it works or not.

    
    /**
     * Filter categories on group create screen
     *
     * @param array $args       An array of get_terms() arguments.
     * @param array $taxonomies An array of taxonomies.
     *
     * @return array
     */
    function buddydev_filter_categories_on_group_create_screen( $args, $taxonomies ) {
    
    	if ( ! function_exists( 'buddypress' ) || ! bp_is_active( 'groups' ) || ! bp_is_group_creation_step( 'blog-categories' ) ) {
    		return $args;
    	}
    	// Replace category ids with your category ids you want to show from the page.
    	$args['include'] = array( 33, 35 );
    
    	return $args;
    }
    
    add_filter( 'get_terms_args', 'buddydev_filter_categories_on_group_create_screen', 10, 2 );
    

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19724

    Hi,Ravi

    Thanks for your answer. With this code , it show the categories which we want to show when create a group .But after that,it show all the categories of the site when the group admin want to create a new blog.

    Then I tried to change plugin setting . I disable Taxonomy .There is no categories showed when group admin create a new blog. And the blog is published as a post to the category selected when the group was created.
    But the problem is there is nothing showed at Group blog .If you click “BLOG”- “post”, it just show “This Group Has No Blog Posts.”

    So how to correct this issue?

    • This reply was modified 5 years, 4 months ago by BIN.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2944
    Ravi on #19738

    Hello Bin,

    Thank you for the acknowledgment. Please remove the previous code and use the following code. It will work. Please let me know if there is an issue.

    
    /**
     * Filter categories on group create screen
     *
     * @param array $args       An array of get_terms() arguments.
     * @param array $taxonomies An array of taxonomies.
     *
     * @return array
     */
    function buddydev_bcg_filter_categories( $args, $taxonomies ) {
    
    	if ( ! function_exists( 'buddypress' ) || ! bp_is_active( 'groups' ) ) {
    		return $args;
    	}
    
    	if ( bp_is_group_creation_step( 'blog-categories' ) || bp_is_group_admin_screen( 'blog-categories' ) ) {
    		// Replace category ids with your category ids you want to show from the page.
    		$args['include'] = array( 33, 35 );
    	}
    
    	return $args;
    }
    
    add_filter( 'get_terms_args', 'buddydev_bcg_filter_categories', 10, 2 );
    
    

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19740

    Hi,Ravi

    Your code works better,but still have some issues.

    .I set several categories for group user creator chose.In the process of creating a group these categories are showed at the step ” blog categories”, but if the user didn’t chose a category, it will after show all categories of my site when publish an article. I don’t want to this .I’d like to set “blog categories” step as a must required option,if no the user can’t go to next step. (Or set a default category in advance at the step ” blog categories”.)

    .And at the group creation “setting ” step, there is an option ” Disable Blog Categories”.If a user chose this option, after finish creation of the group. There is no blog menu showed in this group. So how to remove this option ” Disable Blog Categories”?

    .The current group blog list is in full image and full article.
    How could the blog list show with thumbnail of feature image and the article summary?

    .Now all articles published by different group admin but who join the same directory are listed together.How can I display the articles separately of different groups?
    That’s mean for example there are two user create two different group, user 1 for group 1 and user 2 for group 2 . But these two group join the same category when the group creation. So with this version plugin,the articles created by group 1 and the articles created by group 2 are listed together under these 2 group “blog” menu.

    Is it possible to do that the group 1 blog only lists articles published by group 1?The group 2 blog only lists articles published by group 2?Even if they are assigned the same category?

    Thanks very much for your answer.

    • This reply was modified 5 years, 4 months ago by BIN.
  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19772

    Hi, Ravi

    I’ve found other issue . I allowed group admin to ” Unpublish, Edit ,Delete the article . When the article was published and show in blog list.These three button show under the article. But when the group admin clicked “Unpublish”, the article is still showed in the list; when clicked “edit”,the url show “wp-admin/post.php?post=13541&action=edit” and it show blank page.when clicked “Delete” button, the article is still showed in the list.

    I have used “user role” to set up these users can edit posts.

    And I need the user to edit the page on the front end of the site .

    So if possible, could you also find solution for this issue?

    Thanks again.

    • This reply was modified 5 years, 4 months ago by BIN.
  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19811

    Further answer?

  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #19812

    Hi Bin,

    We will be assisting you on Monday/Onwards. Our Community Support is not available on the weekends.

    Thank you for the patience.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    BIN on #19898

    Hello support team

    Do you have solution for the questions?

  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #19906

    Hi BIN,
    I will be assisting you today. I will be replying within next 2 hours to all the questions.

    Thank you
    Brajesh

The topic ‘ [Resolved] Question about Blog Categories For Groups setting’ is closed to new replies.

This topic is: resolved