在哪里可以访问可用的插件/WordPress更新?

时间:2017-10-04 作者:Keith Donegan

我需要找出在WordPress站点中访问插件更新的位置/方式enter image description here

理想情况下,我希望这些都是json格式的,并提供完整的插件更新列表。

TIA公司

1 个回复
最合适的回答,由SO网友:ssnepenthe 整理而成

插件更新数据缓存在update_plugins 站点瞬态,在response 所有物

$data = get_site_transient( \'update_plugins\' );
var_dump( $data->response );
响应看起来有点像:

array(1) {
  ["wordpress-seo/wp-seo.php"]=>
  object(stdClass)#1873 (11) {
    ["id"]=>
    string(27) "w.org/plugins/wordpress-seo"
    ["slug"]=>
    string(13) "wordpress-seo"
    ["plugin"]=>
    string(24) "wordpress-seo/wp-seo.php"
    ["new_version"]=>
    string(5) "5.5.1"
    ["url"]=>
    string(44) "https://wordpress.org/plugins/wordpress-seo/"
    ["package"]=>
    string(62) "https://downloads.wordpress.org/plugin/wordpress-seo.5.5.1.zip"
    ["icons"]=>
    array(4) {
      ["1x"]=>
      string(66) "https://ps.w.org/wordpress-seo/assets/icon-128x128.png?rev=1550389"
      ["2x"]=>
      string(66) "https://ps.w.org/wordpress-seo/assets/icon-256x256.png?rev=1550389"
      ["svg"]=>
      string(58) "https://ps.w.org/wordpress-seo/assets/icon.svg?rev=1203032"
      ["default"]=>
      string(58) "https://ps.w.org/wordpress-seo/assets/icon.svg?rev=1203032"
    }
    ["banners"]=>
    array(3) {
      ["2x"]=>
      string(69) "https://ps.w.org/wordpress-seo/assets/banner-1544x500.png?rev=1695112"
      ["1x"]=>
      string(68) "https://ps.w.org/wordpress-seo/assets/banner-772x250.png?rev=1695112"
      ["default"]=>
      string(69) "https://ps.w.org/wordpress-seo/assets/banner-1544x500.png?rev=1695112"
    }
    ["banners_rtl"]=>
    array(3) {
      ["2x"]=>
      string(73) "https://ps.w.org/wordpress-seo/assets/banner-1544x500-rtl.png?rev=1695112"
      ["1x"]=>
      string(72) "https://ps.w.org/wordpress-seo/assets/banner-772x250-rtl.png?rev=1695112"
      ["default"]=>
      string(73) "https://ps.w.org/wordpress-seo/assets/banner-1544x500-rtl.png?rev=1695112"
    }
    ["tested"]=>
    string(5) "4.8.2"
    ["compatibility"]=>
    object(stdClass)#1846 (0) {
    }
  }
}
数据是从dot-org插件更新检查端点生成的(some limited documentation) 并在wp_update_plugins() function.

结束