本文整理汇总了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'));
}
示例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'));
}
示例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'));
}
示例4: array
/**
*
* @TODO document
*
*/
function __construct($args = array())
{
parent::__construct($args);
}