Changeset 1336

Show
Ignore:
Timestamp:
06/24/08 17:00:10 (4 months ago)
Author:
donncha
Message:

WP Merge to revision 8180

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-header.php

    r1328 r1336  
    112112<?php } ?> 
    113113 
    114 <div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?> | <?php if ( $gears_compat ) { ?><span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Speed up!') ?></a></span><?php } ?></p></div> 
     114<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( $gears_compat ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Speed up!') ?></a></span><?php } ?></p></div> 
    115115 
    116116<?php 
  • trunk/wp-admin/categories.php

    r1328 r1336  
    135135 
    136136<div class="tablenav"> 
     137 
     138<?php 
     139$pagenum = absint( $_GET['pagenum'] ); 
     140if ( empty($pagenum) ) 
     141        $pagenum = 1; 
     142if( !$catsperpage || $catsperpage < 0 ) 
     143        $catsperpage = 20; 
     144 
     145$page_links = paginate_links( array( 
     146        'base' => add_query_arg( 'pagenum', '%#%' ), 
     147        'format' => '', 
     148        'total' => ceil(wp_count_terms('category') / $catsperpage), 
     149        'current' => $pagenum 
     150)); 
     151 
     152if ( $page_links ) 
     153        echo "<div class='tablenav-pages'>$page_links</div>"; 
     154?> 
    137155 
    138156<div class="alignleft"> 
     
    157175        <tbody id="the-list" class="list:cat"> 
    158176<?php 
    159 cat_rows(); 
     177cat_rows(0, 0, 0, $pagenum, $catsperpage); 
    160178?> 
    161179        </tbody> 
     
    164182 
    165183<div class="tablenav"> 
     184 
     185<?php 
     186if ( $page_links ) 
     187        echo "<div class='tablenav-pages'>$page_links</div>"; 
     188?> 
    166189<br class="clear" /> 
    167190</div> 
  • trunk/wp-admin/css/dashboard-rtl.css

    r1218 r1336  
    1212        float: left; 
    1313        margin: 1px 0 0 6px; 
     14} 
     15 
     16div.dashboard-widget-holder { 
     17        float: right; 
    1418} 
    1519 
     
    5761        margin:0 0 0.2em 0.5em; 
    5862} 
     63#dashboard_secondary div.dashboard-widget-content ul li { 
     64        float: right; 
     65} 
    5966#dashboard_secondary div.dashboard-widget-content ul li a { 
    6067        border-right:0 none; 
  • trunk/wp-admin/css/press-this.css

    r1328 r1336  
    112112font-size: 11px; 
    113113} 
    114 #newtag { padding: 3px; } 
     114#newtag { width: 60%; padding: 3px; } 
    115115 
    116116#wphead { 
     
    295295} 
    296296 
     297#img_container a { 
     298        display: block; 
     299        width: 79px; 
     300        height: 79px; 
     301        float: left; 
     302} 
    297303#img_container img { 
    298304        width: 75px; 
    299305        height: 75px; 
     306        border: 0px; 
    300307        padding: 2px; 
    301308        background-color: #f4f4f4; 
    302         margin-right: 7px; 
    303         margin-bottom: 7px; 
    304309        cursor: pointer; 
    305310} 
     311#img_container a, #img_container a:link, #img_container a:visited { 
     312        border: 2px solid #ccc; 
     313        margin: 0 4px 4px 0; 
     314}  
     315#img_container a:hover, #img_container a:active { 
     316        border: 2px solid #000; 
     317} 
    306318.submit { 
    307 -moz-border-radius-bottomleft: 3px; 
    308 -khtml-border-bottom-left-radius: 3px; 
    309 -webkit-border-bottom-left-radius: 3px; 
    310 border-bottom-left-radius: 3px; 
    311 -moz-border-radius-bottomright: 3px; 
    312 -khtml-border-bottom-right-radius: 3px; 
    313 -webkit-border-bottom-right-radius: 3px; 
    314 border-bottom-right-radius: 3px; 
    315 margin: 0; 
    316 padding: 0; 
     319       -moz-border-radius-bottomleft: 3px; 
     320       -khtml-border-bottom-left-radius: 3px; 
     321       -webkit-border-bottom-left-radius: 3px; 
     322       border-bottom-left-radius: 3px; 
     323       -moz-border-radius-bottomright: 3px; 
     324       -khtml-border-bottom-right-radius: 3px; 
     325       -webkit-border-bottom-right-radius: 3px; 
     326       border-bottom-right-radius: 3px; 
     327       margin: 0; 
     328       padding: 0; 
    317329} 
    318330.submitbox { 
     
    450462        padding-bottom: 2px; 
    451463} 
     464 
     465#photo_directions { 
     466margin-top: .25em; 
     467display: block; 
     468position: relative; 
     469} 
     470#photo_directions span { 
     471display: block; 
     472position: absolute; 
     473top: 0; 
     474right: 3px; 
     475} 
     476#photo_saving { 
     477margin-bottom: 8px; 
     478} 
     479 
     480#post_status { 
     481        margin-left: 10px; 
     482        margin-bottom: 1em; 
     483        display: block; 
     484} 
     485 
     486#footer { 
     487        height: 65px; 
     488        display: block; 
     489        width: 640px; 
     490        padding: 10px 0 0 60px; 
     491        margin: 0; 
     492        position: absolute; 
     493        bottom: 0; 
     494        font-size: 12px; 
     495} 
     496 
     497#footer p { 
     498        margin: 0; 
     499        padding: 7px 0; 
     500} 
     501 
     502#footer p a { 
     503        text-decoration: none; 
     504} 
     505 
     506#footer p a:hover { 
     507        text-decoration: underline; 
  • trunk/wp-admin/edit-category-form.php

    r1328 r1336  
    3333                        <th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th> 
    3434                        <td> 
    35                                 <?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?><br /> 
     35                                <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br /> 
    3636                <?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?> 
    3737                        </td> 
  • trunk/wp-admin/edit-form-advanced.php

    r1328 r1336  
    2323        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 
    2424        $autosave = wp_get_post_autosave( $post_id ); 
    25         if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) 
    26                 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 
     25 
     26        // Detect if there exists an autosave newer than the post and if that autosave is different than the post 
     27        if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { 
     28                foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 
     29                        if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) { 
     30                                $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 
     31                                break; 
     32                        } 
     33                } 
     34                unset($autosave_field, $_autosave_field); 
     35        } 
    2736} 
    2837 
  • trunk/wp-admin/edit-pages.php

    r1328 r1336  
    118118 
    119119<div class="tablenav"> 
     120 
     121<?php 
     122$pagenum = absint( $_GET['pagenum'] ); 
     123if ( empty($pagenum) ) 
     124        $pagenum = 1; 
     125if( !$per_page || $pre_page < 0 ) 
     126        $per_page = 20; 
     127 
     128$num_pages = ceil(count($posts) / $per_page); 
     129$page_links = paginate_links( array( 
     130        'base' => add_query_arg( 'pagenum', '%#%' ), 
     131        'format' => '', 
     132        'total' => $num_pages, 
     133        'current' => $pagenum 
     134)); 
     135 
     136if ( $page_links ) 
     137        echo "<div class='tablenav-pages'>$page_links</div>"; 
     138?> 
    120139 
    121140<div class="alignleft"> 
     
    152171  </thead> 
    153172  <tbody> 
    154   <?php page_rows($posts); ?> 
     173  <?php page_rows($posts, $pagenum, $per_page); ?> 
    155174  </tbody> 
    156175</table> 
     
    170189 
    171190<div class="tablenav"> 
     191<?php 
     192if ( $page_links ) 
     193        echo "<div class='tablenav-pages'>$page_links</div>"; 
     194?> 
    172195<br class="clear" /> 
    173196</div> 
  • trunk/wp-admin/gears-manifest.php

    r1328 r1336  
    2626wp_default_styles($wp_styles); 
    2727 
    28 $get_lang = file_exists( ABSPATH . '/wp-config.php') ? file( ABSPATH . '/wp-config.php' ) : file( dirname(ABSPATH) . '/wp-config.php' ); 
    29  
    30 if ( is_array($get_lang) ) { 
    31         foreach ( $get_lang as $val ) { 
    32                 if ( strpos( $val, "'WPLANG'" ) !== false ) { 
    33                         eval( $val ); 
    34                         break; 
    35                 } 
    36         } 
    37 } 
    38  
    39 if ( defined('WPLANG') && '' != WPLANG ) { 
    40         if ( file_exists(ABSPATH . '/wp-content/languages') && @is_dir(ABSPATH . '/wp-content/languages') ) 
    41                 $langdir = '/wp-content/languages/'; 
    42         else 
    43                 $langdir = '/wp-includes/languages/'; 
    44          
    45         $locale_file = ABSPATH . $langdir . WPLANG . '.php'; 
    46         if ( is_readable($locale_file) ) 
    47                 include_once($locale_file); 
    48 } 
    49  
    50 $rtl = ( isset($text_direction) && 'rtl' == $text_direction ) ? true : false; 
    51  
    5228$defaults = $man_version = ''; 
    5329foreach ( $wp_scripts->registered as $script ) { 
     
    6743        $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n"; 
    6844 
    69         if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) { 
     45        if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) { 
    7046                if ( is_bool( $style->extra['rtl'] ) ) 
    7147                        $rtl_href = str_replace( '.css', '-rtl.css', $src ); 
     
    8864{ 
    8965"betaManifestVersion" : 1, 
    90 "version" : "<?php echo $man_version; ?>_20080606", 
     66"version" : "<?php echo $man_version; ?>_20080622", 
    9167"entries" : [ 
    9268<?php echo $defaults; ?> 
     
    136112{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }, 
    137113 
    138 { "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=3091" }, 
    139 { "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=3091" }, 
    140 { "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=3091" }, 
    141 { "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=3091" }, 
    142 { "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=3091" }, 
    143 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=3091" }, 
    144 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=3091" }, 
    145 { "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=3091" }, 
    146 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=3091" }, 
    147 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=3091" }, 
    148 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=3091" }, 
    149 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3091" }, 
    150 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3091" }, 
    151 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3091" }, 
    152 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3091" }, 
     114{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=3101" }, 
     115{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=3101" }, 
     116{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=3101" }, 
     117{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=3101" }, 
     118{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=3101" }, 
     119{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=3101" }, 
     120{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=3101" }, 
     121{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=3101" }, 
     122{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=3101" }, 
     123{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=3101" }, 
     124{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=3101" }, 
     125{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3101" }, 
     126{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3101" }, 
     127{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3101" }, 
     128{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3101" }, 
    153129 
    154 { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3091" }, 
    155 { "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3091" }, 
    156 { "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=3091" }, 
    157 { "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=3091" }, 
    158 { "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=3091" }, 
    159 { "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=3091" }, 
    160 { "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=3091" }, 
    161 { "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=3091" }, 
    162 { "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=3091" }, 
    163 { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3091" }, 
    164 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3091" }, 
    165 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3091" }, 
    166 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3091" }, 
    167 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=3091" }, 
     130{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3101" }, 
     131{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3101" }, 
     132{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=3101" }, 
     133{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=3101" }, 
     134{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=3101" }, 
     135{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=3101" }, 
     136{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=3101" }, 
     137{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=3101" }, 
     138{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=3101" }, 
     139{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3101" }, 
     140{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3101" }, 
     141{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3101" }, 
     142{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3101" }, 
     143{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=3101" }, 
    168144 
    169 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3091" }, 
    170 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=3091" }, 
    171 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=3091" }, 
    172 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=3091" }, 
    173 { "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=3091" }, 
    174 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=3091" }, 
    175 { "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=3091" }, 
    176 { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3091" }, 
    177 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3091" }, 
    178 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3091" }, 
    179 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3091" }, 
    180 { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3091" }, 
     145{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3101" }, 
     146{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=3101" }, 
     147{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=3101" }, 
     148{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=3101" }, 
     149{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=3101" }, 
     150{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=3101" }, 
     151{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=3101" }, 
     152{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3101" }, 
     153{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3101" }, 
     154{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3101" }, 
     155{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3101" }, 
     156{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=3101" }, 
     157{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3101" }, 
    181158 
    182159{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" }, 
  • trunk/wp-admin/import/wp-cat2tag.php

    r1328 r1336  
    2525 
    2626        function populate_cats() { 
    27                 global $wpdb; 
    2827 
    2928                $categories = get_categories('get=all'); 
    3029                foreach ( $categories as $category ) { 
    3130                        $this->all_categories[] = $category; 
    32                         if ( tag_exists( $wpdb->escape($category->name) ) ) 
     31                        if ( is_term( $category->slug, 'post_tag' ) ) 
    3332                                $this->hybrids_ids[] = $category->term_id; 
    3433                } 
     
    3635 
    3736        function populate_tags() { 
    38                 global $wpdb; 
    3937 
    4038                $tags = get_terms( array('post_tag'), 'get=all' ); 
    4139                foreach ( $tags as $tag ) { 
    4240                        $this->all_tags[] = $tag; 
    43                         if ( $this->_category_exists($tag->term_id) ) 
     41                        if ( is_term( $tag->slug, 'category' ) ) 
    4442                                $this->hybrids_ids[] = $tag->term_id; 
    4543                } 
     
    5351 
    5452                if ( $cat_num > 0 ) { 
    55                         echo '<h2>Convert Categories (' . $cat_num . ') to Tags.</h2>'; 
     53                        echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>'; 
    5654                        echo '<div class="narrow">'; 
    5755                        echo '<p>' . __('Hey there. Here you can selectively converts existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>'; 
     
    5957 
    6058                        $this->categories_form(); 
    61                 } elseif ( $hyb_num > 0 ) { 
    62                          echo '<p>' . __('You have no categories that can be converted. However some of your categories are both a tag and a category.') . '</p>'; 
    6359                } else { 
    6460                        echo '<p>'.__('You have no categories to convert!').'</p>'; 
     
    9389 
    9490<form name="catlist" id="catlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post"> 
    95 <p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()"
     91<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()" /
    9692<?php wp_nonce_field('import-cat2tag'); ?></p> 
    9793<ul style="list-style:none"> 
    98 <?php 
    99               $hier = _get_term_hierarchy('category'); 
     94 
     95<?php $hier = _get_term_hierarchy('category'); 
    10096 
    10197                foreach ($this->all_categories as $category) { 
    10298                        $category = sanitize_term( $category, 'category', 'display' ); 
    10399 
    104                         if ( (int) $category->parent == 0 ) { 
    105                                 if ( in_array( intval($category->term_id),  $this->hybrids_ids ) ) { 
    106 ?> 
    107         <li style="color:#777;padding-left:1.3em;"><?php echo $category->name . ' (' . $category->count . ') *'; ?></li> 
    108 <?php 
    109                                 } else { 
    110 ?> 
     100                        if ( (int) $category->parent == 0 ) { ?> 
     101 
    111102        <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($category->term_id); ?>" /> <?php echo $category->name . ' (' . $category->count . ')'; ?></label><?php 
    112103 
    113                                         if ( isset($hier[$category->term_id]) ) 
    114                                                 $this->_category_children($category, $hier); 
    115 ?></li> 
    116 <?php 
    117                                 } 
    118                         } 
    119                 } 
    120 ?> 
     104                                 if ( in_array( intval($category->term_id),  $this->hybrids_ids ) ) 
     105                                        echo ' <a href="#note"> * </a>'; 
     106                                 
     107                                if ( isset($hier[$category->term_id]) ) 
     108                                        $this->_category_children($category, $hier); ?></li> 
     109<?php           } 
     110                } ?> 
    121111</ul> 
    122112 
    123 <?php 
    124                 if ( ! empty($this->hybrids_ids) ) { 
    125                         echo '<p>' . __('* This category is also a tag. It cannot be convert again.') . '</p>'; 
    126                 } 
    127 ?> 
     113<?php   if ( ! empty($this->hybrids_ids) ) 
     114                        echo '<p><a name="note"></a>' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '</p>'; ?> 
     115 
    128116<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Convert Categories to Tags'); ?>" /></p> 
    129117</form> 
    130118 
    131 <?php 
    132         } 
     119<?php } 
    133120 
    134121        function tags_tab() { 
     
    139126 
    140127                if ( $tags_num > 0 ) { 
    141                         echo '<h2>Convert Tags (' . $tags_num . ') to Categories.</h2>'; 
     128                        echo '<h2>' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>'; 
    142129                        echo '<div class="narrow">'; 
    143130                        echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>'; 
    144131                        echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>'; 
    145                          
    146                          
     132 
    147133                        $this->tags_form(); 
    148                 } elseif ( $hyb_num > 0 ) { 
    149                          echo '<p>' . __('You have no tags that can be converted. However some of your tags are both a tag and a category.') . '</p>'; 
    150134                } else { 
    151135                        echo '<p>'.__('You have no tags to convert!').'</p>'; 
     
    180164 
    181165<form name="taglist" id="taglist" action="admin.php?import=wp-cat2tag&amp;step=4" method="post"> 
    182 <p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()"
     166<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()" /
    183167<?php wp_nonce_field('import-cat2tag'); ?></p> 
    184168<ul style="list-style:none"> 
    185 <?php 
    186                 foreach ( $this->all_tags as $tag ) { 
    187                         if ( in_array( intval($tag->term_id),  $this->hybrids_ids ) ) { 
    188 ?> 
    189         <li style="color:#777;padding-left:1.3em;"><?php echo attribute_escape($tag->name) . ' (' . $tag->count . ') *'; ?></li> 
    190 <?php 
    191                         } else { 
    192 ?> 
    193         <li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label></li> 
    194  
    195 <?php 
    196                         } 
    197                 } 
    198 ?> 
     169 
     170<?php   foreach ( $this->all_tags as $tag ) { ?> 
     171        <li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id),  $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li> 
     172 
     173<?php   } ?> 
    199174</ul> 
    200175 
    201 <?php    
    202                 if ( ! empty($this->hybrids_ids) ) 
    203                         echo '<p>' . __('* This tag is also a category. It cannot be converted again.') . '</p>'; 
    204 ?> 
     176<?php   if ( ! empty($this->hybrids_ids) ) 
     177                        echo '<p><a name="note"></a>' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '</p>'; ?> 
    205178 
    206179<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php _e('Convert Tags to Categories'); ?>" /></p> 
    207180</form> 
    208181 
    209 <?php 
    210         } 
    211  
    212         function _category_children($parent, $hier) { 
    213 ?> 
     182<?php } 
     183 
     184        function _category_children($parent, $hier) { ?> 
    214185 
    215186                <ul style="list-style:none"> 
    216 <?php 
    217                 foreach ($hier[$parent->term_id] as $child_id) { 
    218                         $child =& get_category($child_id); 
    219                          
    220                         if ( in_array( intval($child->term_id), $this->hybrids_ids ) ) { 
    221 ?> 
    222                 <li style="color:#777;padding-left:1.3em;"><?php echo $child->name . ' (' . $child->count . ') *'; ?></li> 
    223 <?php 
    224                         } else { 
    225 ?> 
    226                 <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label> 
    227 <?php 
     187<?php   foreach ($hier[$parent->term_id] as $child_id) { 
     188                        $child =& get_category($child_id); ?> 
     189                <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label><?php 
     190 
     191                        if ( in_array( intval($child->term_id), $this->hybrids_ids ) ) 
     192                                echo ' <a href="#note"> * </a>'; 
    228193 
    229194                        if ( isset($hier[$child->term_id]) ) 
    230                                 $this->_category_children($child, $hier); 
    231 ?>              </li> 
    232 <?php 
    233                         } 
    234                 } 
    235 ?> 
    236                 </ul> 
    237 <?php 
     195                                $this->_category_children($child, $hier); ?></li> 
     196<?php   } ?> 
     197                </ul><?php 
    238198        } 
    239199 
     
    253213                global $wpdb; 
    254214 
    255                 if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { 
    256                         echo '<div class="narrow">'; 
    257                         echo '<p>' . sprintf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag') . '</p>'; 
    258                         echo '</div>'; 
    259                       return; 
     215                if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { ?> 
     216                        <div class="narrow"> 
     217                        <p><?php printf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag'); ?></p> 
     218                        </div> 
     219<?php         return; 
    260220                } 
    261221 
    262222                if ( empty($this->categories_to_convert) ) 
    263223                        $this->categories_to_convert = $_POST['cats_to_convert']; 
     224 
    264225                $hier = _get_term_hierarchy('category'); 
     226                $hybrid_cats = $clear_parents = $parents = false; 
     227                $clean_term_cache = $clean_cat_cache = array(); 
     228                $default_cat = get_option('default_category'); 
    265229 
    266230                echo '<ul>'; 
     
    269233                        $cat_id = (int) $cat_id; 
    270234 
    271                         echo '<li>' . sprintf(__('Converting category #%s ... '),  $cat_id); 
    272  
    273                         if (!$this->_category_exists($cat_id)) { 
    274                                 _e('Category doesn\'t exist!'); 
     235                        if ( ! $this->_category_exists($cat_id) ) { 
     236                                echo '<li>' . sprintf( __('Category %s doesn\'t exist!'),  $cat_id ) . "</li>\n"; 
    275237                        } else { 
    276238                                $category =& get_category($cat_id); 
    277  
    278                                 if ( tag_exists($wpdb->escape($category->name)) ) { 
    279                                         _e('Category is already a tag.'); 
    280                                         echo '</li>'; 
     239                                echo '<li>' . sprintf(__('Converting category <strong>%s</strong> ... '),  $category->name); 
     240 
     241                                // If the category is the default, leave category in place and create tag. 
     242                                if ( $default_cat == $category->term_id ) { 
     243 
     244                                        if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) ) 
     245                                                $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); 
     246                                         
     247                                        $id = $id['term_taxonomy_id']; 
     248                                        $posts = get_objects_in_term($category->term_id, 'category'); 
     249                                        $term_order = 0; 
     250 
     251                                        foreach ( $posts as $post ) { 
     252                                                $values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order); 
     253                                                clean_post_cache($post); 
     254                                        } 
     255                                         
     256                                        if ( $values ) { 
     257                                                $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); 
     258 
     259                                                $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) ); 
     260                                        } 
     261 
     262                                        echo __('Converted successfully.') . "</li>\n"; 
    281263                                        continue; 
    282264                                } 
    283  
    284                                 // If the category is the default, leave category in place and create tag. 
    285                                 if ( get_option('default_category') == $category->term_id ) { 
    286                                         $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); 
    287                                         $id = $id['term_taxonomy_id']; 
    288                                         $posts = get_objects_in_term($category->term_id, 'category'); 
    289                                         foreach ( $posts as $post ) { 
    290                                                 if ( !$wpdb->get_var( $wpdb->prepare("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $post, $id) ) ) 
    291                                                         $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES (%d, %d)", $post, $id) ); 
     265                                 
     266                                // if tag already exists, add it to all posts in the category 
     267                                if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) { 
     268                                        $objects_ids = get_objects_in_term($category->term_id, 'category'); 
     269                                        $tag_ttid = (int) $tag_ttid; 
     270                                        $term_order = 0; 
     271 
     272                                        foreach ( $objects_ids as $object_id ) 
     273                                                $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $term_order); 
     274 
     275&nbs