Changeset 6726 for trunk/wp-admin/includes/template.php
- Timestamp:
- 02/05/2008 06:47:27 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r6713 r6726 240 240 $count = number_format_i18n( $tag->count ); 241 241 $count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count; 242 242 243 243 $out = ''; 244 244 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; … … 247 247 $out .= '<td>' . apply_filters( 'term_name', $tag->name ) . '</td>'; 248 248 249 $out .= "<td>$count</td>"; 249 $out .= "<td>$count</td>"; 250 250 $out .= '<td><a href="edit-tags.php?action=edit&tag_ID=' . $tag->term_id . '" class="edit">' . 251 251 __( 'Edit' ) . "</a></td>" . 252 '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&tag_ID=$tag->term_id", 253 'delete-tag_' . $tag->term_id ) . 252 '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&tag_ID=$tag->term_id", 253 'delete-tag_' . $tag->term_id ) . 254 254 '" class="delete:the-list:tag-' . $tag->term_id . ' delete">' . 255 255 __( 'Delete' ) . "</a></td>"; 256 256 $out .= '</tr>'; 257 257 258 258 return $out; 259 259 } 260 260 261 261 // Outputs appropriate rows for the Nth page of the Tag Management screen, 262 // assuming M tags displayed at a time on the page 262 // assuming M tags displayed at a time on the page 263 263 // Returns the number of tags displayed 264 264 function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) { 265 265 266 266 // Get a page worth of tags 267 267 $start = $page * $pagesize; 268 268 269 269 $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0); 270 270 271 271 if ( !empty( $searchterms ) ) { 272 272 $args['name__like'] = '%' . like_escape( $searchterms ); … … 274 274 275 275 $tags = get_terms( 'post_tag', $args ); 276 276 277 277 // convert it to table rows 278 278 $out = ''; … … 292 292 $count++; 293 293 } 294 294 295 295 // filter and send to screen 296 296 $out = apply_filters('tag_rows', $out); … … 331 331 global $post; 332 332 static $class; 333 333 334 334 $post = $page; 335 335 setup_postdata($page); … … 356 356 357 357 if ( ! $children_pages ) 358 return true; 358 return true; 359 359 360 360 for ( $i = 0; $i < count($children_pages); $i++ ) { 361 361 362 362 $child = $children_pages[$i]; 363 363 364 364 if ( $child->post_parent == $id ) { 365 array_splice($children_pages, $i, 1); 365 array_splice($children_pages, $i, 1); 366 366 display_page_row($child, $children_pages, $level+1); 367 367 $i = -1; //as numeric keys in $children_pages are not preserved after splice … … 371 371 372 372 /* 373 * displays pages in hierarchical order 373 * displays pages in hierarchical order 374 374 */ 375 375 function page_rows( $pages ) { … … 386 386 387 387 foreach ( $pages as $page ) { 388 389 // catch and repair bad pages 388 389 // catch and repair bad pages 390 390 if ( $page->post_parent == $page->ID ) { 391 $page->post_parent = 0; 391 $page->post_parent = 0; 392 392 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) ); 393 393 clean_page_cache( $page->ID ); 394 394 } 395 395 396 396 if ( 0 == $page->post_parent ) 397 $top_level_pages[] = $page; 397 $top_level_pages[] = $page; 398 398 else 399 $children_pages[] = $page; 399 $children_pages[] = $page; 400 400 } 401 401 402 402 foreach ( $top_level_pages as $page ) 403 403 display_page_row($page, $children_pages, 0); 404 405 /* 404 405 /* 406 406 * display the remaining children_pages which are orphans 407 407 * having orphan requires parental attention 408 408 */ 409 409 if ( count($children_pages) > 0 ) { 410 $empty_array = array(); 411 foreach ( $children_pages as $orphan_page ) { 410 $empty_array = array(); 411 foreach ( $children_pages as $orphan_page ) { 412 412 clean_page_cache( $orphan_page->ID); 413 413 display_page_row( $orphan_page, $empty_array, 0 ); 414 } 414 } 415 415 } 416 416 } … … 650 650 if ( $for_post ) 651 651 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 652 652 653 653 $tab_index_attribute = ''; 654 654 if ( (int) $tab_index > 0 )
Note: See TracChangeset
for help on using the changeset viewer.