返回介绍

install_dashboard()

发布于 2017-09-11 01:04:21 字数 2686 浏览 1162 评论 0 收藏 0

install_dashboard()

description


源代码

File: wp-admin/includes/plugin-install.php

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 by clicking the button at the top of this page.' ), __( 'https://wordpress.org/plugins/' ) ); ?></p>

	<?php display_plugins_table(); ?>

	<div class="plugins-popular-tags-wrapper">
	<h2><?php _e( 'Popular tags' ) ?></h2>
	<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 ) {
			$url = self_admin_url( 'plugin-install.php?tab=search&type=tag&s=' . urlencode( $tag['name'] ) );
			$data = array(
				'link' => esc_url( $url ),
				'name' => $tag['name'],
				'slug' => $tag['slug'],
				'id' => sanitize_title_with_dashes( $tag['name'] ),
				'count' => $tag['count']
			);
			$tags[ $tag['name'] ] = (object) $data;
		}
		echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%s plugin'), 'multiple_text' => __('%s plugins') ) );
	}
	echo '</p><br class="clear" /></div>';
}

更新日志

Versiondescription
2.7.0Introduced.

相关函数

Uses

  • wp-admin/includes/plugin-install.php: display_plugins_table()
  • wp-admin/includes/plugin-install.php: install_popular_tags()
  • wp-includes/category-template.php: wp_generate_tag_cloud()
  • wp-includes/l10n.php: __()
  • wp-includes/l10n.php: _e()
  • wp-includes/formatting.php: esc_url()
  • wp-includes/formatting.php: sanitize_title_with_dashes()
  • wp-includes/link-template.php: self_admin_url()
  • wp-includes/load.php: is_wp_error()
  • Show 4 more uses Hide more uses

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文