• Debug is on, no error being output;

    I am trying to retrieve the categories, and then find the specific children categories.

    Before Updating WordPress we are able to accomplish this.

    After updating WordPress, all categories are removed from the media ‘attachment’

    When displaying the contents of get_categories();

    I only have uncategorized

    Array
    (
        [9] => WP_Term Object
            (
                [term_id] => 1
                [name] => Uncategorized
                [slug] => uncategorized
                [term_group] => 0
                [term_taxonomy_id] => 1
                [taxonomy] => category
                [description] => 
                [parent] => 0
                [count] => 4
                [filter] => raw
                [term_order] => 4
                [cat_ID] => 1
                [category_count] => 4
                [category_description] => 
                [cat_name] => Uncategorized
                [category_nicename] => uncategorized
                [category_parent] => 0
            )
    
    )

    This is how we achieve adding taxonomies to attachment post type

    // Add Categories taxonomy for media library attachments
    function add_categories_to_attachments()
    {
    	register_taxonomy_for_object_type('category', 'attachment');
    }
    add_action('init', 'add_categories_to_attachments');
    • This topic was modified 2 years, 7 months ago by rftbdev.
    • This topic was modified 2 years, 7 months ago by rftbdev.
Viewing 5 replies - 1 through 5 (of 5 total)
  • I tested your code in 6.0.1 and can’t find any problem. The categories are available and displayed in the media.

    Can you reset the categories on the media? Are they available at all?

    Have you deactivated all other plugins that are currently available? Maybe one of them is interfering here.

    From which version of WordPress did you update?

    Thread Starter rftbdev

    (@rftbdev)

    I have to enter to slug name for the categories e.g., data-reports unless I go into the specific media attachment it then gives me the checkboxes to select categories in the righthand metadata section.

    I will try unsetting them and resetting them.

    I have had luck getting the categories to ‘show up’ whenever I populate ‘some test posts’ and then assign those test posts to my category names, but when i am assigning the ‘attachment’ post type the categories, the category count is not updating, nor is the attachment truly being assigned to the category, it seems

    Thread Starter rftbdev

    (@rftbdev)

    I have deactivated all plugins minus ACF and issue is still present

    Thread Starter rftbdev

    (@rftbdev)

    updated from version 6.0

    Thread Starter rftbdev

    (@rftbdev)

    on php8

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Post updating to 6.0.1. all taxonomy are wiped from media library ‘attachment’’ is closed to new replies.