Ticket #31483: 31483.diff
File 31483.diff, 5.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/edit-tags.php
69 69 70 70 break; 71 71 72 case 'default': 73 74 if ( ! current_user_can( 'manage_options' ) ) { 75 wp_die( __( 'Cheatin’ uh?' ) ); 76 } 77 78 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 79 if ( ! isset( $_REQUEST['tag_ID'] ) ) { 80 break; 81 } 82 83 $tag_ID = (int) $_REQUEST['tag_ID']; 84 check_admin_referer( 'default-tag_' . $tag_ID ); 85 86 if ( ! term_exists( $tag_ID, $taxonomy ) ) { 87 break; 88 } 89 90 update_option( 'default_' . $taxonomy, $tag_ID ); 91 92 $location = add_query_arg( 'message', 7, $location ); 93 94 break; 95 72 96 case 'delete': 73 97 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 74 98 if ( 'post' != $post_type ) … … 259 283 3 => __( 'Item updated.' ), 260 284 4 => __( 'Item not added.' ), 261 285 5 => __( 'Item not updated.' ), 262 6 => __( 'Items deleted.' ) 286 6 => __( 'Items deleted.' ), 287 7 => __( 'Item set as default.') 263 288 ); 264 289 $messages['category'] = array( 265 290 0 => '', // Unused. Messages start at index 1. … … 268 293 3 => __( 'Category updated.' ), 269 294 4 => __( 'Category not added.' ), 270 295 5 => __( 'Category not updated.' ), 271 6 => __( 'Categories deleted.' ) 296 6 => __( 'Categories deleted.' ), 297 7 => __( 'Category set as default.') 272 298 ); 273 299 $messages['post_tag'] = array( 274 300 0 => '', // Unused. Messages start at index 1. … … 277 303 3 => __( 'Tag updated.' ), 278 304 4 => __( 'Tag not added.' ), 279 305 5 => __( 'Tag not updated.' ), 280 6 => __( 'Tags deleted.' ) 306 6 => __( 'Tags deleted.' ), 307 7 => __( 'Tag set as default.') 281 308 ); 282 309 283 310 /** -
src/wp-admin/includes/class-wp-terms-list-table.php
202 202 $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count ); 203 203 } else { 204 204 $terms = get_terms( $taxonomy, $args ); 205 205 206 foreach ( $terms as $term ) { 206 207 $this->single_row( $term ); 207 208 } … … 306 307 307 308 $default_term = get_option( 'default_' . $taxonomy ); 308 309 310 $default_link_args = array( 311 'action' => 'default', 312 'taxonomy' => $taxonomy, 313 'tag_ID' => $tag->term_id, 314 'paged' => $this->get_pagenum(), 315 ); 316 $default_link = wp_nonce_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ), 'default-tag_' . $tag->term_id ); 317 309 318 $pad = str_repeat( '— ', max( 0, $this->level ) ); 310 319 311 320 /** … … 326 335 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 327 336 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 328 337 338 $default_categories = array( 339 'category', 340 'link_category' 341 ); 342 329 343 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; 330 344 331 345 $actions = array(); … … 333 347 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 334 348 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 335 349 } 350 if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && ( in_array( $taxonomy, $default_categories ) ) ) { 351 $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; 352 } 336 353 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 337 354 $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>"; 338 355 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');