WordPress.org

Make WordPress Core

Ticket #31691: 31691.2.patch

File 31691.2.patch, 910 bytes (added by maximinime, 6 years ago)

Alternative solution

  • (a) a/wp-admin/includes/media.phpX vs. (b) b/wp-admin/includes/media.php

    diff --git a/wp-admin/includes/media.phpX b/wp-admin/includes/media.php
    index fc8ce0f..2f09091 100644
    a b function get_attachment_fields_to_edit($post, $errors = null) { 
    12181218
    12191219        foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
    12201220                $t = (array) get_taxonomy($taxonomy);
    1221                 if ( ! $t['public'] || ! $t['show_ui'] )
     1221                if ( ! $t['public'] && ! $t['show_ui'] )
    12221222                        continue;
    12231223                if ( empty($t['label']) )
    12241224                        $t['label'] = $taxonomy;
    function get_compat_media_markup( $attachment_id, $args = null ) { 
    16041604        if ( $args['in_modal'] ) {
    16051605                foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
    16061606                        $t = (array) get_taxonomy($taxonomy);
    1607                         if ( ! $t['public'] || ! $t['show_ui'] )
     1607                        if ( ! $t['public'] && ! $t['show_ui'] )
    16081608                                continue;
    16091609                        if ( empty($t['label']) )
    16101610                                $t['label'] = $taxonomy;