Ticket #26268: 26268.show.default.diff
File 26268.show.default.diff, 7.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/list-tables.css
725 725 padding: 2px 0 0; 726 726 } 727 727 728 .row-actions a { 729 white-space: nowrap; 730 } 731 728 732 tr:hover .row-actions, 729 733 .mobile .row-actions, 730 734 .row-actions.visible, -
src/wp-admin/edit-tags.php
64 64 wp_redirect( $location ); 65 65 exit; 66 66 67 case 'default': 68 $tag_ID = (int) $_REQUEST['tag_ID']; 69 check_admin_referer( 'default-tag_' . $tag_ID ); 70 71 if ( !current_user_can( 'manage_options' ) ) { 72 wp_die( __( 'Cheatin’ uh?' ) ); 73 } 74 75 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 76 77 if ( !isset( $_REQUEST['tag_ID'] ) ) { 78 wp_redirect( $location ); 79 exit; 80 } 81 82 $tag_ID = (int) $_REQUEST['tag_ID']; 83 84 if ( !term_exists( $tag_ID, $taxonomy ) ) { 85 wp_redirect( $location ); 86 exit; 87 } 88 89 update_option( 'default_' . $taxonomy, $tag_ID ); 90 91 if ( ! empty( $_REQUEST['paged'] ) ) { 92 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); 93 } 94 95 $location = add_query_arg( 'message', 7, $location ); 96 97 wp_redirect( $location ); 98 exit; 99 100 break; 101 67 102 case 'delete': 68 103 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 69 104 if ( 'post' != $post_type ) … … 254 289 3 => __( 'Item updated.' ), 255 290 4 => __( 'Item not added.' ), 256 291 5 => __( 'Item not updated.' ), 257 6 => __( 'Items deleted.' ) 292 6 => __( 'Items deleted.' ), 293 7 => __( 'Item set as default.') 258 294 ); 259 295 $messages['category'] = array( 260 296 0 => '', // Unused. Messages start at index 1. … … 263 299 3 => __( 'Category updated.' ), 264 300 4 => __( 'Category not added.' ), 265 301 5 => __( 'Category not updated.' ), 266 6 => __( 'Categories deleted.' ) 302 6 => __( 'Categories deleted.' ), 303 7 => __( 'Category set as default.') 267 304 ); 268 305 $messages['post_tag'] = array( 269 306 0 => '', // Unused. Messages start at index 1. … … 272 309 3 => __( 'Tag updated.' ), 273 310 4 => __( 'Tag not added.' ), 274 311 5 => __( 'Tag not updated.' ), 275 6 => __( 'Tags deleted.' ) 312 6 => __( 'Tags deleted.' ), 313 7 => __( 'Tag set as default.') 276 314 ); 277 315 278 316 /** -
src/wp-admin/includes/class-wp-terms-list-table.php
270 270 271 271 $default_term = get_option( 'default_' . $taxonomy ); 272 272 273 $default_term_label = ''; 274 if ( $tag->term_id == $default_term ) { 275 $default_term_label = ' - <span class="taxonomy-label"> ' . __( 'Default' ) . '</span>'; 276 } 277 $default_link_args = array( 278 'action' => 'default', 279 'taxonomy' => $taxonomy, 280 'tag_ID' => $tag->term_id, 281 'paged' => $this->get_pagenum(), 282 ); 283 $default_link = wp_nonce_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ), 'default-tag_' . $tag->term_id ); 284 273 285 $pad = str_repeat( '— ', max( 0, $this->level ) ); 274 286 275 287 /** … … 290 302 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 291 303 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 292 304 293 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; 305 $default_categories = array( 306 'category', 307 'link_category' 308 ); 309 310 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a>' . $default_term_label . '</strong><br />'; 294 311 295 312 $actions = array(); 296 313 if ( current_user_can( $tax->cap->edit_terms ) ) { 297 314 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 298 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';315 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 299 316 } 317 if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && ( in_array( $taxonomy, $default_categories ) ) ) { 318 $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; 319 } 300 320 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 301 321 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>"; 302 322 if ( $tax->public ) -
src/wp-admin/includes/template.php
91 91 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . 92 92 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 93 93 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . 94 esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 94 esc_html( apply_filters( 'the_category', $category->name ) ); 95 96 if ($taxonomy == 'category' && get_option( 'default_category' ) == $category->term_id) { 97 $output .= ' <small>(default)</small>'; 98 } 99 100 $output .= '</label>'; 95 101 } 96 102 97 103 /** -
src/wp-admin/options-writing.php
71 71 <label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_option('use_balanceTags')); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label> 72 72 </fieldset></td> 73 73 </tr> 74 <tr>75 <th scope="row"><label for="default_category"><?php _e('Default Post Category') ?></label></th>76 <td>77 74 <?php 78 wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'orderby' => 'name', 'selected' => get_option('default_category'), 'hierarchical' => true));79 ?>80 </td>81 </tr>82 <?php83 75 $post_formats = get_post_format_strings(); 84 76 unset( $post_formats['standard'] ); 85 77 ?> … … 94 86 </select> 95 87 </td> 96 88 </tr> 97 <?php98 if ( get_option( 'link_manager_enabled' ) ) :99 ?>100 <tr>101 <th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>102 <td>103 <?php104 wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'taxonomy' => 'link_category'));105 ?>106 </td>107 </tr>108 <?php endif; ?>109 89 110 90 <?php 111 91 do_settings_fields('writing', 'default');