Changes between Initial Version and Version 1 of Ticket #14877, comment 11
- Timestamp:
- 09/27/2011 04:08:59 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14877, comment 11
initial v1 16 16 17 17 {{{ 18 register_taxonomy_type( $type, $meta_box , $editable = true, $terms) {18 register_taxonomy_type( $type, $meta_box ) { 19 19 20 20 // add $type to valid taxonomy types … … 22 22 // associate the meta box callback function with the $type 23 23 24 // if $editable is false then don't show 'add new' links or main admin UI25 // and rescind manage_terms capabilities26 27 // if $terms is supplied these would be the default terms in the taxonomy28 // $terms should be required when $editable is false29 30 24 } 31 25 }}} 32 26 33 So for post formatsyou'd have:27 So for the exclusive type you'd have: 34 28 35 29 {{{ 36 30 register_taxonomy_type( 37 'post_format', 38 'post_formats_meta_box', 39 false, 40 array( 'gallery' => __( 'Gallery' ), 'video' => __( 'Video' ), ...etc... ) 31 'exclusive', 32 'exclusive_taxonomy_meta_box' 41 33 ); 42 34 }}} … … 46 38 47 39 This is probably what you had in mind already but wanted to get my ideas down in the appropriate place. 40 41 42 '''Edit.''' 43 You would need to extend register_taxonomy() to accept two more arguments: 44 45 editable = boolean 46 // if $editable is false then don't show 'add new' links or main admin UI and rescind manage_terms capabilities 47 48 terms = array 49 // if $terms is supplied these would be the default terms in the taxonomy. $terms should be required when $editable is false