本文整理匯總了PHP中TGM_Plugin_Activation::admin_init方法的典型用法代碼示例。如果您正苦於以下問題:PHP TGM_Plugin_Activation::admin_init方法的具體用法?PHP TGM_Plugin_Activation::admin_init怎麽用?PHP TGM_Plugin_Activation::admin_init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TGM_Plugin_Activation
的用法示例。
在下文中一共展示了TGM_Plugin_Activation::admin_init方法的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;
}