← All changes
|
vendor/codeinwp/themeisle-sdk/src/Modules/Recommendation.php
+43
-0
4.0.5
→
3.7.7
View file →
| @@ -238,8 +238,51 @@ | ||
| 238 | 238 | return $list; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | + * Call plugin api | |
| 243 | + * | |
| 244 | + * @param string $slug plugin slug. | |
| 245 | + * | |
| 246 | + * @return array|mixed|object | |
| 247 | + */ | |
| 248 | + private function call_plugin_api( $slug ) { | |
| 249 | + include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; | |
| 250 | + | |
| 251 | + $call_api = get_transient( 'ti_plugin_info_' . $slug ); | |
| 252 | + | |
| 253 | + if ( false === $call_api ) { | |
| 254 | + $call_api = plugins_api( | |
| 255 | + 'plugin_information', | |
| 256 | + array( | |
| 257 | + 'slug' => $slug, | |
| 258 | + 'fields' => array( | |
| 259 | + 'downloaded' => false, | |
| 260 | + 'rating' => false, | |
| 261 | + 'description' => false, | |
| 262 | + 'short_description' => true, | |
| 263 | + 'donate_link' => false, | |
| 264 | + 'tags' => false, | |
| 265 | + 'sections' => true, | |
| 266 | + 'homepage' => true, | |
| 267 | + 'added' => false, | |
| 268 | + 'last_updated' => false, | |
| 269 | + 'compatibility' => false, | |
| 270 | + 'tested' => false, | |
| 271 | + 'requires' => false, | |
| 272 | + 'downloadlink' => false, | |
| 273 | + 'icons' => true, | |
| 274 | + 'banners' => true, | |
| 275 | + ), | |
| 276 | + ) | |
| 277 | + ); | |
| 278 | + set_transient( 'ti_plugin_info_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS ); | |
| 279 | + } | |
| 280 | + | |
| 281 | + return $call_api; | |
| 282 | + } | |
| 283 | + | |
| 284 | + /** | |
| 242 | 285 | * Load css and scripts for the plugin recommend page. |
| 243 | 286 | */ |
| 244 | 287 | public function enqueue() { |
| 245 | 288 | $screen = get_current_screen(); |