Ticket #26268: 26268.2.diff
File 26268.2.diff, 6.0 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/list-tables.css
715 715 padding: 2px 0 0; 716 716 } 717 717 718 .row-actions a { 719 white-space: nowrap; 720 } 721 718 722 tr:hover .row-actions, 719 723 .mobile .row-actions, 720 724 .row-actions.visible, -
src/wp-admin/edit-tags.php
65 65 exit; 66 66 break; 67 67 68 case 'default': 69 $tag_ID = (int) $_REQUEST['tag_ID']; 70 check_admin_referer( 'default-tag_' . $tag_ID ); 71 72 if ( !current_user_can( 'manage_options' ) ) { 73 wp_die( __( 'Cheatin’ uh?' ) ); 74 } 75 76 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 77 78 if ( !isset( $_REQUEST['tag_ID'] ) ) { 79 wp_redirect( $location ); 80 exit; 81 } 82 83 $tag_ID = (int) $_REQUEST['tag_ID']; 84 85 if ( !term_exists( $tag_ID, $taxonomy ) ) { 86 wp_redirect( $location ); 87 exit; 88 } 89 90 update_option( 'default_' . $taxonomy, $tag_ID ); 91 92 if ( ! empty( $_REQUEST['paged'] ) ) { 93 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); 94 } 95 96 $location = add_query_arg( 'message', 7, $location ); 97 98 wp_redirect( $location ); 99 exit; 100 101 break; 102 68 103 case 'delete': 69 104 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 70 105 if ( 'post' != $post_type ) … … 260 295 3 => __( 'Item updated.' ), 261 296 4 => __( 'Item not added.' ), 262 297 5 => __( 'Item not updated.' ), 263 6 => __( 'Items deleted.' ) 298 6 => __( 'Items deleted.' ), 299 7 => __( 'Item set as default.') 264 300 ); 265 301 $messages['category'] = array( 266 302 0 => '', // Unused. Messages start at index 1. … … 269 305 3 => __( 'Category updated.' ), 270 306 4 => __( 'Category not added.' ), 271 307 5 => __( 'Category not updated.' ), 272 6 => __( 'Categories deleted.' ) 308 6 => __( 'Categories deleted.' ), 309 7 => __( 'Category set as default.') 273 310 ); 274 311 $messages['post_tag'] = array( 275 312 0 => '', // Unused. Messages start at index 1. … … 278 315 3 => __( 'Tag updated.' ), 279 316 4 => __( 'Tag not added.' ), 280 317 5 => __( 'Tag not updated.' ), 281 6 => __( 'Tags deleted.' ) 318 6 => __( 'Tags deleted.' ), 319 7 => __( 'Tag set as default.') 282 320 ); 283 321 284 322 /** -
src/wp-admin/includes/class-wp-terms-list-table.php
268 268 269 269 $default_term = get_option( 'default_' . $taxonomy ); 270 270 271 $default_term_label = ''; 272 if ( $tag->term_id == $default_term ) { 273 $default_term_label = ' - <span class="taxonomy-label"> ' . __( 'Default' ) . '</span>'; 274 } 275 $default_link_args = array( 276 'action' => 'default', 277 'taxonomy' => $taxonomy, 278 'tag_ID' => $tag->term_id, 279 'paged' => $this->get_pagenum(), 280 ); 281 $default_link = wp_nonce_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ), 'default-tag_' . $tag->term_id ); 282 271 283 $pad = str_repeat( '— ', max( 0, $this->level ) ); 272 284 273 285 /** … … 288 300 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 289 301 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 290 302 291 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a> </strong><br />';303 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a>' . $default_term_label . '</strong><br />'; 292 304 293 305 $actions = array(); 294 306 if ( current_user_can( $tax->cap->edit_terms ) ) { 295 307 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 296 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';308 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 297 309 } 310 if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && ( 'category' || 'link_category' ) == $this->screen->taxonomy ) { 311 $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; 312 } 298 313 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 299 314 $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>"; 300 315 if ( $tax->public ) -
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');