Ticket #26268: 26268.diff
File 26268.diff, 3.9 KB (added by , 11 years ago) |
---|
-
src/wp-admin/edit-tags.php
65 65 exit; 66 66 break; 67 67 68 case 'default': 69 if ( !current_user_can( 'manage_options' ) ) { 70 wp_die( __( 'Cheatin’ uh?' ) ); 71 } 72 73 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 74 75 if ( !isset( $_REQUEST['tag_ID'] ) ) { 76 wp_redirect( $location ); 77 exit; 78 } 79 80 $tag_ID = (int) $_REQUEST['tag_ID']; 81 82 if ( !term_exists( $tag_ID, $taxonomy ) ) { 83 wp_redirect( $location ); 84 exit; 85 } 86 87 update_option( 'default_' . $taxonomy, $tag_ID ); 88 89 wp_redirect( $location ); 90 exit; 91 92 break; 93 68 94 case 'delete': 69 95 $location = 'edit-tags.php?taxonomy=' . $taxonomy; 70 96 if ( 'post' != $post_type ) -
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 ); 280 $default_link = esc_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ) ); 281 271 282 $pad = str_repeat( '— ', max( 0, $this->level ) ); 272 283 273 284 /** … … 288 299 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 289 300 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 290 301 291 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a> </strong><br />';302 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a>' . $default_term_label . '</strong><br />'; 292 303 293 304 $actions = array(); 294 305 if ( current_user_can( $tax->cap->edit_terms ) ) { 295 306 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 296 307 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 297 308 } 309 if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && 'category' == $this->screen->taxonomy ) { 310 $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; 311 } 298 312 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 299 313 $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 314 if ( $tax->public ) -
src/wp-admin/options-writing.php
77 77 <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> 78 78 </fieldset></td> 79 79 </tr> 80 <tr>81 <th scope="row"><label for="default_category"><?php _e('Default Post Category') ?></label></th>82 <td>83 80 <?php 84 wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'orderby' => 'name', 'selected' => get_option('default_category'), 'hierarchical' => true));85 ?>86 </td>87 </tr>88 <?php89 81 $post_formats = get_post_format_strings(); 90 82 unset( $post_formats['standard'] ); 91 83 ?>