Changeset 6799
- Timestamp:
- 02/12/08 09:02:02 (9 months ago)
- Files:
-
- trunk/wp-admin/categories.php (modified) (1 diff)
- trunk/wp-admin/includes/template.php (modified) (3 diffs)
- trunk/wp-admin/link-manager.php (modified) (1 diff)
- trunk/wp-includes/taxonomy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/categories.php
r6213 r6799 85 85 86 86 <div class="wrap"> 87 <form id="posts-filter" action="" method="get"> 87 88 <?php if ( current_user_can('manage_categories') ) : ?> 88 <h2><?php printf(__(' Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>89 <h2><?php printf(__('Manage Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2> 89 90 <?php else : ?> 90 <h2><?php _e(' Categories') ?> </h2>91 <h2><?php _e('Manage Categories') ?> </h2> 91 92 <?php endif; ?> 93 94 <p id="post-search"> 95 <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 96 <input type="submit" value="<?php _e( 'Search Categories' ); ?>" /> 97 </p> 98 99 <br style="clear:both;" /> 100 101 <div class="tablenav"> 102 103 <div style="float: left"> 104 <input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 105 </div> 106 107 <br style="clear:both;" /> 108 </div> 109 </form> 110 111 <br style="clear:both;" /> 112 92 113 <table class="widefat"> 93 114 <thead> 94 115 <tr> 95 <th scope="col" style="text-align: center"><?php _e('ID') ?></th>116 <th scope="col"><div style="text-align: center"><input type="checkbox" name="TODO" /></div></th> 96 117 <th scope="col"><?php _e('Name') ?></th> 97 118 <th scope="col"><?php _e('Description') ?></th> 98 119 <th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th> 99 <th colspan="2" style="text-align: center"><?php _e('Action') ?></th>100 120 </tr> 101 121 </thead> trunk/wp-admin/includes/template.php
r6797 r6799 7 7 // Dandy new recursive multiple category stuff. 8 8 function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { 9 if ( !$categories ) 10 $categories = get_categories( 'hide_empty=0' ); 9 if ( !$categories ) { 10 $args = array('hide_empty' => 0); 11 if ( !empty($_GET['s']) ) 12 $args['search'] = $_GET['s']; 13 $categories = get_categories( $args ); 14 } 11 15 12 16 $children = _get_term_hierarchy('category'); … … 39 43 $pad = str_repeat( '— ', $level ); 40 44 if ( current_user_can( 'manage_categories' ) ) { 41 $edit = "<a href='categories.php?action=edit&cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>";45 $edit = "<a href='categories.php?action=edit&cat_ID=$category->term_id'>". ( $name_override ? $name_override : $pad . ' ' . $category->name ) ."</a>"; 42 46 $default_cat_id = (int) get_option( 'default_category' ); 43 44 if ( $category->term_id != $default_cat_id ) 45 $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&cat_ID=$category->term_id", 'delete-category_' . $category->term_id ) . "' class='delete:the-list:cat-$category->term_id delete'>".__( 'Delete' )."</a>"; 46 else 47 $edit .= "<td style='text-align:center'>".__( "Default" ); 48 } else 49 $edit = ''; 47 } else { 48 $edit = ( $name_override ? $name_override : $pad . ' ' . $category->name ); 49 } 50 50 51 51 $class = " class='alternate'" == $class ? '' : " class='alternate'"; … … 54 54 $posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count; 55 55 $output = "<tr id='cat-$category->term_id'$class> 56 <th scope='row' style='text-align: center'> $category->term_id</th>57 <td> " . ( $name_override ? $name_override : $pad . ' ' . $category->name ) . "</td>56 <th scope='row' style='text-align: center'><input type='checkbox' name='delete[]' value='$category->term_id' /></th> 57 <td>$edit</td> 58 58 <td>$category->description</td> 59 <td align='center'>$posts_count</td> 60 <td>$edit</td>\n\t</tr>\n"; 59 <td align='center'>$posts_count</td>\n\t</tr>\n"; 61 60 62 61 return apply_filters('cat_row', $output); trunk/wp-admin/link-manager.php
r6798 r6799 118 118 $cat_id = ''; 119 119 $args = array('category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0); 120 if ( $_GET['s'])120 if ( !empty($_GET['s']) ) 121 121 $args['search'] = $_GET['s']; 122 122 $links = get_bookmarks( $args ); trunk/wp-includes/taxonomy.php
r6738 r6799 526 526 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 527 527 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 528 'pad_counts' => false, 'offset' => '' );528 'pad_counts' => false, 'offset' => '', 'search' => ''); 529 529 $args = wp_parse_args( $args, $defaults ); 530 530 $args['number'] = absint( $args['number'] ); … … 635 635 } else 636 636 $number = ''; 637 638 if ( !empty($search) ) { 639 $search = like_escape($search); 640 $where .= " AND (t.name LIKE '%$search%')"; 641 } 637 642 638 643 if ( 'all' == $fields )
