Esempio n. 1
0
    /** @see WP_Widget::form */
    function form($instance)
    {
        nktagcloud_load_translation_file();
        $defaults = nktagcloud_defaults();
        // get default values
        $instance = wp_parse_args((array) $instance, $defaults['config']);
        $title = esc_attr($instance['title']);
        ?>
		<p>
			<?php 
        $this->nktagcloud_input(__('Title', 'nktagcloud'), 'title', 15, $title);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Taxonomy', 'nktagcloud'), 'taxonomy', 15, $instance['taxonomy']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Smallest font size', 'nktagcloud'), 'smallest', 4, $instance['smallest']);
        ?>
			<?php 
        $this->nktagcloud_input(__('Largest font size', 'nktagcloud'), 'largest', 4, $instance['largest']);
        ?>
			<?php 
        $this->nktagcloud_select(__('Unit', 'nktagcloud'), 'unit', array('pt', 'px', '%', 'em', 'ex', 'mm'), $instance['unit']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Numbers of tags to show', 'nktagcloud'), 'number', 4, $instance['number']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_select(__('Format', 'nktagcloud'), 'format', array('flat', 'list'), $instance['format']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_select(__('Order', 'nktagcloud'), 'order', array('ASC', 'DESC', 'RAND'), $instance['order']);
        ?>
			<?php 
        $this->nktagcloud_select(__('Orderby', 'nktagcloud'), 'orderby', array('name', 'count', 'both'), $instance['orderby']);
        ?>
			<p>
				<?php 
        _e("The 'both' option of <tt>Orderby</tt> will sort by post count first and then by name. It doesn't exist in the default tag cloud and will ignore the <tt>Order</tt> option.", 'nktagcloud');
        ?>
			</p>

			<?php 
        $this->nktagcloud_select(__('Add post count to tags?', 'nktagcloud'), 'inject_count', array('No', 'Yes'), $instance['inject_count']);
        ?>
			<?php 
        $this->nktagcloud_select(__('Put the post count outside of the hyperlink?', 'nktagcloud'), 'inject_count_outside', array('No', 'Yes'), $instance['inject_count_outside']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Show only tags that have been used at least so many times:', 'nktagcloud'), 'mincount', 4, $instance['mincount']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_select(__('Add categories to tag cloud?', 'nktagcloud'), 'categories', array('No', 'Yes'), $instance['categories']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_select(__('Force tags with multiple words on one line?', 'nktagcloud'), 'replace', array('No', 'Yes'), $instance['replace']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Tag separator', 'nktagcloud'), 'separator', 4, $instance['separator']);
        ?>
			<?php 
        $this->nktagcloud_select(__('Hide the last separator?', 'nktagcloud'), 'hidelastseparator', array('No', 'Yes'), $instance['hidelastseparator']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_select(__('Add the nofollow attribute?', 'nktagcloud'), 'nofollow', array('No', 'Yes'), $instance['nofollow']);
        ?>
			<br />

			<h3><?php 
        _e('Exclude/Include tags', 'nktagcloud');
        ?>
</h3>
			<p>
				<?php 
        _e('Comma separated list of tags (term_id) to exclude or include. For example, <tt>exclude=5,27</tt> means that tags that have the <tt>term_id</tt> 5 or 27 will NOT be displayed. See <a href="http://codex.wordpress.org/Template_Tags/wp_tag_cloud">Template Tags/wp tag cloud</a>.', 'nktagcloud');
        ?>
			</p>
			<?php 
        $this->nktagcloud_input(__('Exclude Tags', 'nktagcloud'), 'exclude', 40, $instance['exclude']);
        ?>
			<br />
			<?php 
        $this->nktagcloud_input(__('Include Tags', 'nktagcloud'), 'include', 40, $instance['include']);
        ?>
			<br />
		</p>
		<?php 
    }
Esempio n. 2
0
/**
 * Reset the tag cloud to default values
 *
 * @since 0.8.0alpha-1
 */
function nktagcloud_reset()
{
    $default = nktagcloud_defaults();
    update_option('nktagcloud', $default);
}