本文整理汇总了PHP中display_plugins_table函数的典型用法代码示例。如果您正苦于以下问题:PHP display_plugins_table函数的具体用法?PHP display_plugins_table怎么用?PHP display_plugins_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_plugins_table函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install_updated
/**
* Display recently updated plugins.
*
* @since 2.7.0
*
* @param string $page
*/
function install_updated($page = 1)
{
$args = array('browse' => 'updated', 'page' => $page);
$api = plugins_api('query_plugins', $args);
display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
}
示例2: install_dashboard
function install_dashboard()
{
?>
<p><?php
printf(__('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.'), 'https://wordpress.org/plugins/', self_admin_url('plugin-install.php?tab=upload'));
?>
</p>
<?php
display_plugins_table();
?>
<h3><?php
_e('Popular tags');
?>
</h3>
<p><?php
_e('You may also browse based on the most popular tags in the Plugin Directory:');
?>
</p>
<?php
$api_tags = install_popular_tags();
echo '<p class="popular-tags">';
if (is_wp_error($api_tags)) {
echo $api_tags->get_error_message();
} else {
//Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()
$tags = array();
foreach ((array) $api_tags as $tag) {
$tags[$tag['name']] = (object) array('link' => esc_url(self_admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name']))), 'name' => $tag['name'], 'id' => sanitize_title_with_dashes($tag['name']), 'count' => $tag['count']);
}
echo wp_generate_tag_cloud($tags, array('single_text' => __('%s plugin'), 'multiple_text' => __('%s plugins')));
}
echo '</p><br class="clear" />';
}
示例3: install_updated
/**
* Display recently updated plugins.
*
* @since 2.7.0
*
* @param string $page
*/
function install_updated($page = 1)
{
$args = array('browse' => 'updated', 'page' => $page);
$api = plugins_api('query_plugins', $args);
if (is_wp_error($api)) {
wp_die($api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
}
display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
}