当前位置: 首页>>代码示例>>PHP>>正文


PHP Plugin_Upgrader::__construct方法代码示例

本文整理汇总了PHP中Plugin_Upgrader::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin_Upgrader::__construct方法的具体用法?PHP Plugin_Upgrader::__construct怎么用?PHP Plugin_Upgrader::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugin_Upgrader的用法示例。


在下文中一共展示了Plugin_Upgrader::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Set plugin info and add essential hooks
  * 
  * @param string $plugin_slug                 The name of directory and main file name of plugin
  * @param string $slug                        Then slug name of plugin (optional)
  * @param string $installable_plugin_zip_file Installable update file name. Default is {plugin_slug}-installable.zip
  */
 public function __construct($plugin_slug, $slug = '', $installable_plugin_zip_file = '')
 {
     parent::__construct();
     $this->plugin_slug = $plugin_slug;
     $parts = explode('/', $plugin_slug);
     $this->slug = empty($slug) ? str_replace('.php', '', $parts[1]) : $slug;
     $this->installable_plugin_zip_file = empty($installable_plugin_zip_file) ? $this->slug . '-installable.zip' : $installable_plugin_zip_file;
     add_action('admin_init', array($this, 'plugin_update_rows'), 12);
     // a custom hook that fires on update.php page while upgrading package
     add_action("update-custom_{$this->slug}-upgrade", array($this, 'on_update_plugin'));
 }
开发者ID:namleduc,项目名称:thqc,代码行数:18,代码来源:class-axiom-plugin-updater.php

示例2: __construct

 /**
  * Set plugin info and add essential hooks
  *
  * @param string $plugin_slug                 The name of directory and main file name of plugin
  * @param string $slug                        Then slug name of plugin (optional)
  * @param string $installable_plugin_zip_file Installable update file name. Default is {plugin_slug}-installable.zip
  */
 public function __construct($plugin_slug, $slug = '', $installable_plugin_zip_file = '')
 {
     parent::__construct();
     $this->plugin_slug = $plugin_slug;
     $parts = explode('/', $plugin_slug);
     $this->slug = empty($slug) ? str_replace('.php', '', $parts[1]) : $slug;
     $this->installable_plugin_zip_file = empty($installable_plugin_zip_file) ? $this->slug . '-installable.zip' : $installable_plugin_zip_file;
     add_action('admin_init', array($this, 'plugin_update_rows'), 12);
     // a custom hook that fires on update.php page while upgrading the packages
     add_action("update-custom_{$this->slug}-upgrade", array($this, 'custom_upgrade_plugin'));
     // add_action( "upgrader_process_complete", array( $this, "on_bulk_upgrader_process_complete" ), 10, 2 );
     add_filter('site_transient_update_plugins', array($this, 'define_package_for_plugin_update_transient'));
 }
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:20,代码来源:class-axiom-plugin-updater.php

示例3: __construct

 /**
  * References parent constructor and sets defaults for class.
  *
  * @since 2.2.0
  *
  * @param \Bulk_Upgrader_Skin|null $skin Installer skin.
  */
 public function __construct($skin = null)
 {
     // Get TGMPA class instance.
     $this->tgmpa = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
     parent::__construct($skin);
     if (isset($this->skin->options['install_type']) && 'update' === $this->skin->options['install_type']) {
         $this->clear_destination = true;
     }
     if ($this->tgmpa->is_automatic) {
         $this->activate_strings();
     }
     add_action('upgrader_process_complete', array($this->tgmpa, 'populate_file_path'));
 }
开发者ID:GvarimAZA,项目名称:website,代码行数:20,代码来源:class-tgm-plugin-activation.php

示例4: array

 /**
  *
  * @TODO document
  *
  */
 function __construct($args = array())
 {
     parent::__construct($args);
 }
开发者ID:climo,项目名称:PageLines-Framework,代码行数:9,代码来源:library.extension.php


注:本文中的Plugin_Upgrader::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。