Tagged: taxonomies
- This topic has 1 reply, 2 voices, and was last updated 6 years, 9 months ago by
Steve.
-
AuthorPosts
-
-
April 27, 2015 at 1:39 pm #3648
ianmuscatMemberHi,
I’m trying to build a custom taxonomy that is private. The idea is that is exists in the WP admin interface but it is not available on the front-end (or to non-logged in users).
I’m using the following code to register my taxonomy. I’d like to make particular reference to
'public' => false– This is what does not seem to work. I’m using this based off this WP codex article – https://codex.wordpress.org/Function_Reference/register_taxonomy#Example_Private_Taxonomyadd_filter('piklist_taxonomies', 'example_products'); function example_products($taxonomies) { $taxonomies[] = array( 'post_type' => 'example' ,'name' => 'example_products' ,'show_admin_column' => true ,'public' => false ,'configuration' => array( 'hide_meta_box' => true ,'labels' => piklist('taxonomy_labels', 'Products') ,'rewrite' => array( 'with_front' => false ,'slug' => 'example/product' ) ) ); return $taxonomies; }Also, it’s not made clear in the documentation what the reason for the ‘configuration’ array when setting up a taxonomy. I can’t find it in WP’s docs, so I’m assuming it is a Piklist thing, but it’s not clear when something should or shouldn’t go in the configuration array. Furthermore, this doesn’t seem to be in-line with registering post types (since registering post typed does not seem to require the use of the configuration array).
Any help would be greatly appreciated!
Ian -
April 27, 2015 at 5:09 pm #3650
SteveKeymaster@ianmuscat– I suggest you get it working properly with the standard WordPress function. Then you can port it over to us the Piklist filter if you like.
-
-
AuthorPosts
- You must be logged in to reply to this topic.