Making WordPress.org


Ignore:
Timestamp:
04/10/2018 02:42:42 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: Use geopattern icon assets in the plugins/update-check API response.

This change populates the update_source table which the update-check API uses, another change is needed to the update check itself to pull them through.
Additionally a bin script to trigger an update for a single row (or all) is included.

See #3265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php

    r7048 r7072  
    390390        if ( ! $icon || 'publish' !== $plugin->post_status ) {
    391391            $generated = true;
    392             $icon = self::get_geopattern_icon_url( $plugin );
     392            $icon = $svg = self::get_geopattern_icon_url( $plugin );
    393393        }
    394394
     
    441441     *
    442442     * @param int|\WP_Post|null $post   Optional. Post ID or post object. Defaults to global $post.
    443      * @param string            $output Optional. Output type. 'html' or 'raw'. Default: 'raw'.
     443     * @param string            $output Optional. Output type. 'html', 'raw', or 'raw_with_rtl'. Default: 'raw'.
    444444     * @return mixed
    445445     */
     
    473473        }
    474474
    475         if ( is_rtl() ) {
     475        if ( is_rtl() || 'raw_with_rtl' == $output ) {
    476476            foreach ( $rtl_banners as $info ) {
    477477                switch ( $info['resolution'] ) {
    478478                    case '1544x500':
    479                         $banner_2x = self::get_asset_url( $plugin, $info );
     479                        $field = 'raw_with_rtl' == $output ? 'banner_2x_rtl' : 'banner_2x';
     480                        $$field = self::get_asset_url( $plugin, $info );
    480481                        break;
    481482
    482483                    case '772x250':
    483                         $banner = self::get_asset_url( $plugin, $info );
     484                        $field = 'raw_with_rtl' == $output ? 'banner_rtl' : 'banner';
     485                        $$field = self::get_asset_url( $plugin, $info );
    484486                        break;
    485487                }
     
    506508
    507509            case 'raw':
     510            case 'raw_with_rtl':
    508511            default:
    509                 return compact( 'banner', 'banner_2x' );
     512                return compact( 'banner', 'banner_2x', 'banner_rtl', 'banner_2x_rtl' );
    510513        }
    511514    }
Note: See TracChangeset for help on using the changeset viewer.