rudrastyh / misha-update-checker

This simple plugin does nothing, only gets updates from a custom server
124 stars 44 forks source link

How set plugin logo? #13

Open IWSBY opened 1 year ago

IWSBY commented 1 year ago

Hello, on the update page /wp-admin/update-core.php in the list of plugins when a new update is available with information about the plugin has an icon. This solution does not describe how to add it? Is there any information on how to do this?

изображение

brasofilo commented 6 months ago

1) add "icons" to your info.json file:

    "banners" : {
      "low" : "https://example.com/banner-772x250.jpg",
      "high" : "https://example.com/banner-1544x500.jpg"
    },
    "icons" : {
      "default" : "https://example.com/icon-256x256.jpg"
    }

WP accepts the following icon types: 'svg', '2x', '1x', 'default'

2) Add this to the info() method:

if( ! empty( $remote->icons ) ) {
    $res->icons = array(
        'default' => $remote->icons->default
    );
}

I only added one icon (256x256 pixels), add the others if you wish.

3) Add this to the update() method:

if( isset( $remote->icons ) ) {
    $res->icons = json_decode(json_encode($remote->icons), true);
}