[wp-hackers] disabling built-in taxonomies? (WAS: can't edit custom taxonomy term)
Steve Taylor
steve at sltaylor.co.uk
Wed May 11 18:03:06 UTC 2011
Yes, I was missing something. I've got some code that I'm using to
globally disable tags, as they're not being used on this project:
add_action( 'init', 'remove_taxonomies' );
function slt_remove_taxonomies() {
global $wp_taxonomies;
unset( $wp_taxonomies['post_tag'] );
}
I always knew this was harsh, though the inability to edit other
taxonomy terms is the first glitch I've found.
Anyway, I've switched to the less brutal, but equally inelegant method
of removing the tags submenu, meta box, and posts list column.
Is there a better / best way of disabling built-in taxonomies?
cheers,
Steve
On 10 May 2011 15:29, Steve Taylor <steve at sltaylor.co.uk> wrote:
> Hi,
>
> I have a custom taxonomy, and while I can add terms, I can't edit them
> (I get "Cheatin' huh?"). I'm an administrator, with no role
> customization.
>
> Using a code inspector, I've edited the form action from
> "edit-tags.php" to "edit-tags.php?taxonomy=eventtype", and it works.
>
> It looks like the edit-tags.php form passes the taxonomy as a hidden
> field and the form submits with the post method, but the permissions
> check at the top of the edit-tags.php file, is based on $taxnow. AFAIK
> this is set in admin.php around line 97, and is set from the $_GET
> vars.
>
> Am I missing something here?
>
> FWIW, here's my taxonomy declaration:
>
> register_taxonomy(
> 'eventtype', 'sparks_event',
> array(
> 'hierarchical' => true,
> 'query_var' => true,
> 'rewrite' => true
> 'labels' => array(
> 'name' => __( 'Event types' ),
> 'singular_name' => __( 'Event type' ),
> 'search_items' => __( 'Search Event types' ),
> 'all_items' => __( 'All Event types' ),
> 'edit_item' => __( 'Edit Event type' ),
> 'update_item' => __( 'Update Event type' ),
> 'add_new_item' => __( 'Add New Event type' ),
> 'new_item_name' => __( 'New Event type Name' ),
> )
> )
> );
>
> cheers,
>
> Steve Taylor
>
More information about the wp-hackers
mailing list