When a site unregisters a taxonomy for the post type used by Press This (e.g. unregister_taxonomy_for_object_type( 'post_tag', 'post' )), the Tags and Categories panels still appear in the editor.
The current code checks user capabilities via get_taxonomy()->cap, but get_taxonomy() returns the taxonomy object even when it's no longer associated with the post type. The panels should only display when the taxonomy is actually registered for the post type.
Steps to reproduce:
- Add
unregister_taxonomy_for_object_type( 'post_tag', 'post' ) to a plugin or theme
- Open Press This
- The Tags panel still appears in the sidebar
Expected: The Tags panel should be hidden.
Fix: Use is_object_in_taxonomy() to check taxonomy registration for the post type before checking capabilities and querying terms.
Originally reported in https://wordpress.org/support/topic/issues-with-the-updated-press-this/