- This topic has 5 replies, 2 voices, and was last updated 7 years, 6 months ago by
catacaly.
Viewing 5 reply threads
-
AuthorPosts
-
-
July 17, 2014 at 5:00 pm #2024
catacalyMemberAnyone else have any clue as to why this might be…?
-
July 18, 2014 at 9:23 am #2027
-
July 18, 2014 at 11:41 am #2028
catacalyMemberadd_filter('piklist_post_types', 'listing_post_type'); function listing_post_type($post_types) { $post_types['vessel'] = array( 'labels' => piklist('post_type_labels', 'Listing') ,'title' => __('Enter boat name') ,'public' => true ,'hierarchical' => false ,'has_archive' => true ,'rewrite' => false/*array( 'slug' => 'vessel' )*/ ,'supports' => array( 'title' ,'author' ,'revisions' ,'thumbnail' //,'editor' //,'excerpt' ) ,'can_export' => true ,'edit_columns' => array( 'title' => __('Name') ,'author' => __('Created by') ) ,'hide_meta_box' => array( 'slug' ,'author' //,'revisions' //,'comments' //,'commentstatus' ) ,'post_states' => true ,'status' => array( 'draft' => array( 'label' => 'Draft' ,'public' => false ) ,'active' => array( 'label' => 'For Sale' ,'public' => true ) ,'inactive' => array( 'label' => 'Inactive' ,'public' => false ) ,'contract' => array( 'label' => 'Under Contract' ,'public' => true ) ,'sold' => array( 'label' => 'Sold' ,'public' => true ) ,'expired' => array( 'label' => 'Expired' ,'public' => false ) ) ,'capabilities' => array( 'edit_post' => 'edit_listing', 'edit_posts' => 'edit_listings', 'edit_others_posts' => 'edit_others_listings', 'publish_posts' => 'publish_listings', 'read_post' => 'read_listing', 'read_private_posts' => 'read_private_listings', 'delete_post' => 'delete_listing' ) ,'map_meta_cap' => true ); return $post_types; } function apply_listing_caps() { // gets the administrator role $admins = get_role( 'administrator' ); $admins->add_cap( 'edit_listing' ); $admins->add_cap( 'edit_listings' ); $admins->add_cap( 'edit_others_listings' ); $admins->add_cap( 'publish_listings' ); $admins->add_cap( 'read_listing' ); $admins->add_cap( 'read_private_listings' ); $admins->add_cap( 'delete_listing' ); add_role( 'dd', 'DD', array( 'edit_listing' => true, 'edit_listings' => true, 'edit_others_listings' => true, 'publish_listings' => true, 'read_listing' => true, 'read_private_listings' => true, 'delete_listing' => false )); } add_action( 'admin_init', 'apply_listing_caps'); add_filter('piklist_taxonomies', 'vessel_make_models'); function vessel_make_models($taxonomies) { $taxonomies[] = array( 'post_type' => 'vessel' ,'name' => 'make' ,'show_admin_column' => true ,'hide_meta_box' => true ,'configuration' => array( 'hierarchical' => false ,'labels' => piklist('taxonomy_labels', 'Manufacturer') ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'make' ) ) ); $taxonomies[] = array( 'post_type' => 'vessel' ,'name' => 'model' ,'show_admin_column' => true ,'hide_meta_box' => true ,'configuration' => array( 'hierarchical' => false ,'labels' => piklist('taxonomy_labels', 'Model') ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'model' ) ) ); return $taxonomies; } -
July 18, 2014 at 4:29 pm #2030
SteveKeymasterThere was a typo in our documentation.
hide_meta_boxshould go inside the configuration array:,'configuration' => array( 'hierarchical' => false ,'hide_meta_box' => true ,'labels' => piklist('taxonomy_labels', 'Model') ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'model' ) ) -
July 19, 2014 at 12:12 pm #2031
catacalyMemberThanks. I should’ve tried that.
Same with show_admin_column, while you’re at it 🙂
-
July 19, 2014 at 12:29 pm #2032
catacalyMemberIs there an easy-peasy-Piklist way of adding custom or default fields to admin columns?
-
-
AuthorPosts
Viewing 5 reply threads
- The topic ‘Taxonomies with 'hide_meta_box' => true still showing metaboxes?’ is closed to new replies.