Tagged: buddyblog, Frontend, Hide Categories, Hide Tags, ID's
Hello BuddyDev Team
Thank you for creating an amazing plugin. I would like to know if it’s possible to hide certain category and tag ID’s via php on my bp-custom.php file. I would like some categories to be for verified members that the admin selects (example: the medical category & tag for health practitioners only). I would like to hide which tags, categories are shown frontend to users.
Thank You.
Regards
PresPhuture
Hi PresPhuture,
Thank you for posting.
Yes, it is possible to control which category/tags are shown/** * Filter the BuddyBlog form settings and limit category/tag inclusion. * * @param array $settings settings array. * * @return array */ function buddydev_filter_buddyblog_form_settings( $settings ) { $tax = isset( $settings['tax'] ) ? $settings['tax'] : array(); $tax['category']['include'] = array( 1, 2, 3 );// category ids to include. $tax['post_tag']['include'] = array( 5, 7, 9 );// tag ids to include. $settings['tax'] = $tax; return $settings; } add_filter( 'buddyblog_post_form_settings', 'buddydev_filter_buddyblog_form_settings' );
Please change the ids with your own. It will only list the category tags with those ids. I hope you can modify it form there on.
Hope that helps.
Regards
BrajeshHi Brajesh
Unfortunately the code didn’t work. When I go to the frontend, all of the categories and post tags are there, not those I specifically chosen for the frontend or buddyblog.
Hi PresPhuture,
I will check it on a demo and let you know today. I am not sure what is wrong with the above code.Regards
BrajeshHi Brajesh
Hope you had a great Christmas and Boxing day. I would like to know if there is any update regarding the demo.
Regards
PresPhuture
Hi Ravi
I’m using the normal WordPress post categories and taxinomies.
Regards
PresPhutureHi Ravi
How do I send a screenshot on buddydev as there isn’t an upload image menu.
Regards
PresPhuture
The topic ‘ [Resolved] Buddyblog: Hide certain Categories and Tags’ is closed to new replies.