Changeset 7778
- Timestamp:
- 04/22/2008 10:46:09 PM (16 years ago)
- Location:
- branches/2.5
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/wp-admin/admin-ajax.php
r7659 r7778 163 163 continue; 164 164 $category = get_category( $cat_id ); 165 $checked_categories[] = $cat_id;166 165 ob_start(); 167 dropdown_categories( 0, $category);166 wp_category_checklist( 0, $cat_id, $checked_categories ); 168 167 $data = ob_get_contents(); 169 168 ob_end_clean(); -
branches/2.5/wp-admin/includes/template.php
r7770 r7778 149 149 } 150 150 151 function wp_category_checklist( $post_id = 0 ) {151 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false ) { 152 152 $walker = new Walker_Category_Checklist; 153 $descendants_and_self = (int) $descendants_and_self; 153 154 154 155 $args = array(); … … 158 159 else 159 160 $args['selected_cats'] = array(); 160 $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10 ) ); 161 $categories = get_categories('get=all'); 161 if ( is_array( $selected_cats ) ) 162 $args['selected_cats'] = $selected_cats; 163 $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); 164 if ( $descendants_and_self ) { 165 $categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" ); 166 $self = get_category( $descendants_and_self ); 167 array_unshift( $categories, $self ); 168 } else { 169 $categories = get_categories('get=all'); 170 } 171 162 172 $args = array($categories, 0, $args); 163 173 $output = call_user_func_array(array(&$walker, 'walk'), $args); … … 167 177 168 178 function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10 ) { 169 $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number ) );179 $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); 170 180 171 181 $popular_ids = array(); -
branches/2.5/wp-admin/js/post.js
r7670 r7778 132 132 var val = th.find('input').val(); 133 133 var id = th.find('input')[0].id 134 jQuery('#' + id).change( syncChecks ) ;134 jQuery('#' + id).change( syncChecks ).change(); 135 135 if ( newCatParent.find( 'option[value=' + val + ']' ).size() ) 136 136 return; -
branches/2.5/wp-includes/script-loader.php
r7773 r7778 145 145 'cancel' => __('Cancel'), 146 146 ) ); 147 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '200804 11' );147 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080422' ); 148 148 $this->localize( 'post', 'postL10n', array( 149 149 'tagsUsed' => __('Tags used on this post:'),
Note: See TracChangeset
for help on using the changeset viewer.