• This hook adds categories to attachments but only as a text field as opposed to the normal checkboxes – how would I go about getting checkboxes in a metabox as normal

    //* Add categories to attachments / media library
    add_action( 'init' , 'wt_add_categories_to_attachments' );
    function wt_add_categories_to_attachments() {
        register_taxonomy_for_object_type( 'category', 'attachment' );
    }
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The usual category metabox appears on my site’s edit media screen with your code. There must be a conflict with one of your plugins or your theme. Try deactivating all plugins and switching to one of the twenty* themes. Temporarily place your code in that theme’s functions.php. The category meta box will appear. Switch back to your normal theme, adding your category code if necessary. If you lose the meta box, your theme has a conflict. If OK, restore your plugins one at a time. When the meta box again fails to appear, the last activated plugin is at fault.

Viewing 1 replies (of 1 total)
  • The topic ‘Add categories to media library’ is closed to new replies.