WordPress.org

Making WordPress.org

Changeset 8273


Ignore:
Timestamp:
02/19/2019 01:53:28 AM (20 months ago)
Author:
dd32
Message:

Theme Directory: API: Return the 'custom-logo' theme tag for WP 4.6+ and setup the wide-blocks and block-styles tags for WP 5.2+.

See https://core.trac.wordpress.org/ticket/46272
See #3921.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r7729 r8273  
    276276            unset( $tags[ __( 'Features' ) ]['blavatar'] );
    277277            $tags[ __( 'Features' ) ]['footer-widgets'] = __( 'Footer Widgets' );
     278            $tags[ __( 'Features' ) ]['custom-logo']    = __( 'Custom Logo' );
    278279            asort( $tags[ __( 'Features' ) ] ); // To move footer-widgets to the right place.
    279280
     
    289290                'portfolio'      => __( 'Portfolio' ),
    290291            );
     292        }
     293
     294        // Pending https://core.trac.wordpress.org/ticket/46272
     295        if ( ! isset( $wp_version ) || version_compare( $wp_version, '5.2-alpha', '>=' ) ) {
     296            $tags[ __( 'Layout' ) ]['wide-blocks']    = __( 'Wide Blocks' );
     297            $tags[ __( 'Features' ) ]['block-styles'] = __( 'Block Editor Styles' );
     298            asort( $tags[ __( 'Features' ) ] ); // To move block-styles to the right place.
    291299        }
    292300
     
    429437        }
    430438
    431         $this->fields = array_merge( $this->fields, $defaults, (array) $this->request->fields );
     439        if ( isset( $this->request->fields ) ) {
     440            $this->fields = array_merge( $this->fields, $defaults, (array) $this->request->fields );
     441        } else {
     442            $this->fields = array_merge( $this->fields, $defaults );
     443        }
    432444
    433445        // If there is a cached result, return that.
Note: See TracChangeset for help on using the changeset viewer.