本文整理汇总了PHP中TGM_Plugin_Activation::get_installed_version方法的典型用法代码示例。如果您正苦于以下问题:PHP TGM_Plugin_Activation::get_installed_version方法的具体用法?PHP TGM_Plugin_Activation::get_installed_version怎么用?PHP TGM_Plugin_Activation::get_installed_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGM_Plugin_Activation
的用法示例。
在下文中一共展示了TGM_Plugin_Activation::get_installed_version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _gather_plugin_data
/**
* Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
*
* @since 2.2.0
*
* @return array $table_data Information for use in table.
*/
protected function _gather_plugin_data()
{
// Load thickbox for plugin links.
$this->tgmpa->admin_init();
$this->tgmpa->thickbox();
// Categorize the plugins which have open actions.
$plugins = $this->categorize_plugins_to_views();
// Set the counts for the view links.
$this->set_view_totals($plugins);
// Prep variables for use and grab list of all installed plugins.
$table_data = array();
$i = 0;
// Redirect to the 'all' view if no plugins were found for the selected view context.
if (empty($plugins[$this->view_context])) {
$this->view_context = 'all';
}
foreach ($plugins[$this->view_context] as $slug => $plugin) {
$table_data[$i]['sanitized_plugin'] = $plugin['name'];
$table_data[$i]['slug'] = $slug;
$table_data[$i]['plugin'] = '<strong>' . $this->tgmpa->get_info_link($slug) . '</strong>';
$table_data[$i]['source'] = $this->get_plugin_source_type_text($plugin['source_type']);
$table_data[$i]['type'] = $this->get_plugin_advise_type_text($plugin['required']);
$table_data[$i]['status'] = $this->get_plugin_status_text($slug);
$table_data[$i]['installed_version'] = $this->tgmpa->get_installed_version($slug);
$table_data[$i]['minimum_version'] = $plugin['version'];
$table_data[$i]['available_version'] = $this->tgmpa->does_plugin_have_update($slug);
if (!empty($plugin['description'])) {
$table_data[$i]['description'] = $plugin['description'];
}
// Prep the upgrade notice info.
$upgrade_notice = $this->tgmpa->get_upgrade_notice($slug);
if (!empty($upgrade_notice)) {
$table_data[$i]['upgrade_notice'] = $upgrade_notice;
add_action("tgmpa_after_plugin_row_{$slug}", array($this, 'wp_plugin_update_row'), 10, 2);
}
$table_data[$i] = apply_filters('tgmpa_table_data_item', $table_data[$i], $plugin);
$i++;
}
return $table_data;
}