WordPress.org

Make WordPress Core

Ticket #21104: 21104-sw-1.diff

File 21104-sw-1.diff, 465 bytes (added by simonwheatley, 3 years ago)

Patch to prevent taxonomy fields showing on media item edit form if show_ui is false

  • wp-admin/includes/media.php

     
    965965 
    966966        foreach ( get_attachment_taxonomies($post) as $taxonomy ) { 
    967967                $t = (array) get_taxonomy($taxonomy); 
    968                 if ( ! $t['public'] ) 
     968                if ( ! $t['public'] || ! $t['show_ui'] ) 
    969969                        continue; 
    970970                if ( empty($t['label']) ) 
    971971                        $t['label'] = $taxonomy;