boonebgorges / buddypress-docs

GNU General Public License v3.0
105 stars 44 forks source link

Set 'public' taxonomy property to false #717

Closed r-a-y closed 3 months ago

r-a-y commented 2 years ago

BuddyPress Docs registers certain taxonomies for internal purposes that should not be public such as 'bp_docs_access' and 'bp_docs_comment_access'.

These taxonomies can be exposed when get_taxonomies( array( 'public' => true ) ) is used. Most prominently is with the wp-sitemap.xml file generated by WordPress.

This PR sets the two mentioned taxonomies above to 'public' => false. One thing I wasn't sure about was the 'bp_docs_associated_item' taxonomy: https://github.com/boonebgorges/buddypress-docs/blob/d69ab86a2fe6c6f3a61dca6425bc60a9208c3949/bp-docs.php#L333-L340

A rewrite slug is attached to this taxonomy, so I didn't really want to mess with this one without further feedback.

boonebgorges commented 2 years ago

Thanks for this, @r-a-y. I'm unsure why the 'rewrite' param was ever added for the 'bp_docs_associated_item' taxonomy - must be for a feature that was never implemented. It should be safe to set to 'public' => false like the other two taxonomies. Could you update the PR accordingly?

r-a-y commented 3 months ago

It should be safe to set to 'public' => false like the other two taxonomies. Could you update the PR accordingly?

Apologies for returning to this one late. I've just updated the PR to set the 'bp_docs_associated_item' taxonomy's 'public' flag to false. I've also gone ahead and removed the 'query_var' flag as well since it doesn't look like it is needed, but let me know if you'd rather I omit the change from this PR.

boonebgorges commented 3 months ago

Thanks!