346 | | $result=$this->运行( |
347 | | 阵列( |
348 | | “package”=>$r->package, |
349 | | “目的地”=>WP_PLUGIN_DIR, |
350 | | “clear_destination”=>true, |
351 | | “clear_working”=>true, |
352 | | “is_multi”=>为真, |
353 | | “hook_extra”=>数组( |
354 | | “插件”=>$plugin, |
355 | | 'temp_backup'=>数组( |
356 | | 'slug'=>目录名($plugin), |
357 | | “src”=>WP_PLUGIN_DIR, |
358 | | “dir”=>“插件”, |
| 350 | if(isset($r->需要)&!is_wp_version_compatible($r->需要){ |
| 351 | $result=新WP_Error( |
| 352 | '不兼容的wp_required_version', |
| 353 | 短跑( |
| 354 | /*翻译人员:1:当前WordPress版本,2:新插件版本所需的WordPres版本*/ |
| 355 | __('您的WordPress版本是%1$s,但新插件版本需要%2$s。'), |
| 356 | $wp_version, |
| 357 | $r->需要 |
| 358 | ) |
| 359 | ); |
| 360 | |
| 361 | $this->skin->before($result); |
| 362 | $this->skin->error($result); |
| 363 | $this->skin->after(); |
| 364 | }elseif(isset($r->requires_php)&!is_php_version_compatible($r->requires_php){ |
| 365 | $result=新WP_Error( |
| 366 | '不兼容_php_required_version', |
| 367 | 冲刺( |
| 368 | /*转换器:1:当前PHP版本,2:新插件版本所需的PHP版本*/ |
| 369 | __('您服务器上的PHP版本是%1$s,但新插件版本需要%2$s。'), |
| 370 | PHP_版本, |
| 371 | $r->需要_php |
| 372 | ) |
| 373 | ); |
| 374 | |
| 375 | $this->skin->before($result); |
| 376 | $this->skin->error($result); |
| 377 | $this->skin->after(); |
| 378 | }其他{ |
| 379 | add_filter('upgrader_source_selection',数组($this,'check_package')); |
| 380 | $result=$this->运行( |
| 381 | 阵列( |
| 382 | “package”=>$r->package, |
| 383 | “目的地”=>WP_PLUGIN_DIR, |
| 384 | “clear_destination”=>true, |
| 385 | “clear_working”=>true, |
| 386 | “is_multi”=>为真, |
| 387 | 'hook_extra'=>数组( |
| 388 | 'plugin'=>$plugin, |
| 389 | “temp_backup”=>数组( |
| 390 | “slug”=>目录名($plugin), |
| 391 | “src”=>WP_PLUGIN_DIR, |
| 392 | “dir”=>“插件”, |
| 393 | ), |