diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php
index 56fa11a..0ec25a3 100644
a
|
b
|
case 'add-tag': |
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 ) |
diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php
index f44b626..2f9bd63 100644
a
|
b
|
class WP_Terms_List_Table extends WP_List_Table { |
245 | 245 | |
246 | 246 | $default_term = get_option( 'default_' . $taxonomy ); |
247 | 247 | |
| 248 | $default_term_label = ''; |
| 249 | if ( $tag->term_id == $default_term ) { |
| 250 | $default_term_label = ' - <span class="taxonomy-label"> ' . __( 'Default' ) . '</span>'; |
| 251 | } |
| 252 | $default_link_args = array( |
| 253 | 'action' => 'default', |
| 254 | 'taxonomy' => $taxonomy, |
| 255 | 'tag_ID' => $tag->term_id, |
| 256 | ); |
| 257 | $default_link = esc_url( add_query_arg( $default_link_args, admin_url( 'edit-tags.php' ) ) ); |
| 258 | |
248 | 259 | $pad = str_repeat( '— ', max( 0, $this->level ) ); |
249 | 260 | $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); |
250 | 261 | $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); |
251 | 262 | $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); |
252 | 263 | |
253 | | $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; |
| 264 | $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a>' . $default_term_label . '</strong><br />'; |
254 | 265 | |
255 | 266 | $actions = array(); |
256 | 267 | if ( current_user_can( $tax->cap->edit_terms ) ) { |
257 | 268 | $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; |
258 | 269 | $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; |
259 | 270 | } |
| 271 | if ( current_user_can( 'manage_options' ) && $tag->term_id != $default_term && 'category' == $this->screen->taxonomy ) { |
| 272 | $actions['default'] = '<a href="' . $default_link . '">' . __( 'Set as Default' ) . '</a>'; |
| 273 | } |
260 | 274 | if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) |
261 | 275 | $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>"; |
262 | 276 | if ( $tax->public ) |
diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php
index 7810b29..89e494e 100644
a
|
b
|
include( ABSPATH . 'wp-admin/admin-header.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 | | <?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 | 80 | <?php |
89 | 81 | $post_formats = get_post_format_strings(); |
90 | 82 | unset( $post_formats['standard'] ); |