Ticket #26268: 26268.5.diff
File 26268.5.diff, 5.9 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/list-tables.css
741 741 padding: 2px 0 0; 742 742 } 743 743 744 .row-actions a { 745 white-space: nowrap; 746 } 747 744 748 tr:hover .row-actions, 745 749 .mobile .row-actions, 746 750 .row-actions.visible, -
src/wp-admin/edit-tags.php
66 66 67 67 break; 68 68 69 case 'default': 70 71 if ( ! current_user_can( 'manage_options' ) ) { 72 wp_die( __( 'Cheatin’ uh?' ) ); 73 } 74 75 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 76 if ( ! isset( $_REQUEST['tag_ID'] ) ) { 77 break; 78 } 79 80 $tag_ID = (int) $_REQUEST['tag_ID']; 81 check_admin_referer( 'default-tag_' . $tag_ID ); 82 83 if ( ! term_exists( $tag_ID, $taxonomy ) ) { 84 break; 85 } 86 87 update_option( 'default_' . $taxonomy, $tag_ID ); 88 89 $location = add_query_arg( 'message', 7, $location ); 90 91 break; 92 69 93 case 'delete': 70 94 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 71 95 if ( 'post' != $post_type ) … … 256 280 3 => __( 'Item updated.' ), 257 281 4 => __( 'Item not added.' ), 258 282 5 => __( 'Item not updated.' ), 259 6 => __( 'Items deleted.' ) 283 6 => __( 'Items deleted.' ), 284 7 => __( 'Item set as default.') 260 285 ); 261 286 $messages['category'] = array( 262 287 0 => '', // Unused. Messages start at index 1. … … 265 290 3 => __( 'Category updated.' ), 266 291 4 => __( 'Category not added.' ), 267 292 5 => __( 'Category not updated.' ), 268 6 => __( 'Categories deleted.' ) 293 6 => __( 'Categories deleted.' ), 294 7 => __( 'Category set as default.') 269 295 ); 270 296 $messages['post_tag'] = array( 271 297 0 => '', // Unused. Messages start at index 1. … … 274 300 3 => __( 'Tag updated.' ), 275 301 4 => __( 'Tag not added.' ), 276 302 5 => __( 'Tag not updated.' ), 277 6 => __( 'Tags deleted.' ) 303 6 => __( 'Tags deleted.' ), 304 7 => __( 'Tag set as default.') 278 305 ); 279 306 280 307 /** -
src/wp-admin/includes/class-wp-terms-list-table.php
280 280 281 281 $default_term = get_option( 'default_' . $taxonomy ); 282 282 283 $default_term_label = ''; 284 if ( $tag->term_id == $default_term ) { 285 $default_term_label = ' - <span class="taxonomy-label"> ' . __( 'Default' ) . '</span>'; 286 } 287 $default_link_args = array( 288 'action' => 'default', 289 'taxonomy' => $taxonomy, 290 'tag_ID' => $tag->term_id, 291 'paged' => $this->get_pagenum(), 292 ); 293 $default_link = wp_nonce_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ), 'default-tag_' . $tag->term_id ); 294 283 295 $pad = str_repeat( '— ', max( 0, $this->level ) ); 284 296 285 297 /** … … 300 312 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 301 313 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 302 314 303 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; 315 $default_categories = array( 316 'category', 317 'link_category' 318 ); 319 320 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a>' . $default_term_label . '</strong><br />'; 304 321 305 322 $actions = array(); 306 323 if ( current_user_can( $tax->cap->edit_terms ) ) { 307 324 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 308 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';325 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 309 326 } 327 if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && ( in_array( $taxonomy, $default_categories ) ) ) { 328 $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; 329 } 310 330 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 311 331 $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>"; 312 332 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');