'0.99',
'config' => array(
'categories' => 'No', // Include catsegories
'decor' => 'notouch', // CSS for tag links
'colorize' => 'No', // CSS for tag links
'exclude' => '',
'format' => 'list',
'homelink' => 'Yes', // Remove link to homepage
'inject_count' => 'No', // Add tag counter
'inject_count_outside' => 'Yes', // Do not link the counter
'include' => '',
'largest' => '22',
'mincount' => 0, // minimum count to show
'number' => '0', // Tag limit
'order' => 'ASC',
'orderby' => 'name',
'rmcss' => 'No', // Remove plugin CSS
'replace' => 'No', // blanks to
'separator' => '', // Separator symbol
'hidelastseparator' => 'No', // Separator symbol
'smallest' => '8',
'title' => 'Tags',
'unit' => 'pt',
'nofollow' => 'No',
'hideemptywidgetheader' => 'No',
'taxonomy' => 'post_tag',
),
);
return $default;
}
/**
* Reset the tag cloud to default values
*
* @since 0.8.0alpha-1
*/
function nktagcloud_reset() {
$default = nktagcloud_defaults();
update_option( 'nktagcloud', $default );
}
/**
* Migrate from earlier messy option model to cleaner layout
*
* @since 0.8.0alpha-1
*/
function nktagcloud_migrate_to_0_8_0() {
// It's save to reset since the new option doesn't exist pre 0.8.0
nktagcloud_reset();
$option = get_option( 'nktagcloud' );
// All pre 0.8.0 settings
$settings = array( 'categories', 'decor', 'exclude', 'format', 'homelink', 'include', 'inject_count', 'inject_count_outside', 'largest', 'number', 'order', 'orderby', 'replace', 'rmcss', 'smallest', 'title', 'unit' );
foreach ($settings as $setting) {
// Import and delete all old settings
if ( get_option( "nktagcloud_$setting" ) ) {
$option['config'][$setting] = get_option( "nktagcloud_$setting" );
}
delete_option( "nktagcloud_$setting" );
}
update_option( 'nktagcloud', $option );
}
/**
* The widget controls
*
* TODO maybe add basic configuration here?
*/
function nktagcloud_control() {
print '' . __( 'This widget is deprecated, please use the new one on the left.', 'nktagcloud' ) . '
';
printf( __( "There were too many options, so I had to move the configuration to a settings page." ), get_bloginfo( 'url' ) . '/wp-admin/options-general.php?page=nktagcloud' );
}
/**
* Add menu configuration page to the menu
*/
function nktagcloud_add_pages() {
$page = add_options_page( __( 'Better Tag Cloud', 'nktagcloud' ), __( 'Better Tag Cloud', 'nktagcloud' ), 10, 'nktagcloud', 'nktagcloud_options_page');
add_action( 'admin_head-' . $page, 'nktagcloud_css_admin' );
// Add icon
add_filter( 'ozh_adminmenu_icon_nktagcloud', 'nktagcloud_icon' );
}
/**
* Return admin menu icon
*
* @return string path to icon
*
* @since 0.8.5
*/
function nktagcloud_icon() {
global $nktagcloud;
return $nktagcloud['url'] . 'pic/tag_blue.png';
}
/**
* Load admin CSS style
*
* @since 0.8.3
*
* @todo check if this is correct
*/
function nktagcloud_css_admin() {
global $nktagcloud; ?>
'; var_dump( $_POST ); echo ''; echo '
New It is now possible to insert a tag cloud into any post or page. Just put the [nktagcloud] shortcode into any post or page.', 'nktagcloud' ) ?>
the wp_tag_cloud() page for a detailed description of the options.', 'nktagcloud' ) ?>