當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。