Ticket #17705: 17705.diff
File 17705.diff, 6.2 KB (added by , 14 years ago) |
---|
-
wp-includes/admin-bar.php
89 89 90 90 /* Add the "My Account" sub menus */ 91 91 $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) ); 92 if ( is_multisite() )93 $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );94 else95 $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );96 92 $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Log Out' ), 'href' => wp_logout_url() ) ); 97 93 } 98 94 } 99 95 100 96 /** 97 * Add the "Dashboard"/"View Site" menu. 98 * 99 * @since 3.2.0 100 */ 101 function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) { 102 if ( is_admin() ) 103 $wp_admin_bar->add_menu( array( 'title' => __( 'Visit Site' ), 'href' => home_url() ) ); 104 elseif ( is_multisite() ) 105 $wp_admin_bar->add_menu( array( 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( get_current_user_id() ) ) ); 106 else 107 $wp_admin_bar->add_menu( array( 'title' => __( 'Dashboard' ), 'href' => admin_url() ) ); 108 } 109 110 /** 101 111 * Add the "My Sites/[Site Name]" menu and all submenus. 102 112 * 103 113 * @since 3.1.0 … … 160 170 * @since 3.1.0 161 171 */ 162 172 function wp_admin_bar_edit_menu( $wp_admin_bar ) { 163 $current_object = get_queried_object();173 global $post, $tag; 164 174 165 if ( empty($current_object) )166 return;175 if ( is_admin() ) { 176 $current_screen = get_current_screen(); 167 177 168 if ( ! empty( $current_object->post_type ) && ( $post_type_object = get_post_type_object( $current_object->post_type ) ) && current_user_can( $post_type_object->cap->edit_post, $current_object->ID ) && ( $post_type_object->show_ui || 'attachment' == $current_object->post_type ) ) { 169 $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $post_type_object->labels->edit_item, 'href' => get_edit_post_link( $current_object->ID ) ) ); 170 } elseif ( ! empty( $current_object->taxonomy ) && ( $tax = get_taxonomy( $current_object->taxonomy ) ) && current_user_can( $tax->cap->edit_terms ) && $tax->show_ui ) { 171 $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $tax->labels->edit_item, 'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) ) ); 178 if ( 'post' == $current_screen->base 179 && 'add' != $current_screen->action 180 && ( $post_type_object = get_post_type_object( $post->post_type ) ) 181 && current_user_can( $post_type_object->cap->read_post, $post->ID ) 182 && ( $post_type_object->public ) ) 183 { 184 $wp_admin_bar->add_menu( array( 185 'id' => 'view', 186 'title' => $post_type_object->labels->view_item, 187 'href' => get_permalink( $post->ID ) 188 ) ); 189 } elseif ( 'edit-tags' == $current_screen->base 190 && isset( $tag ) && is_object( $tag ) 191 && ( $tax = get_taxonomy( $tag->taxonomy ) ) 192 && $tax->public ) 193 { 194 $wp_admin_bar->add_menu( array( 195 'id' => 'view', 196 'title' => $tax->labels->view_item, 197 'href' => get_term_link( $tag ) 198 ) ); 199 } 200 } else { 201 $current_object = get_queried_object(); 202 203 if ( empty($current_object) ) 204 return; 205 206 if ( ! empty( $current_object->post_type ) 207 && ( $post_type_object = get_post_type_object( $current_object->post_type ) ) 208 && current_user_can( $post_type_object->cap->edit_post, $current_object->ID ) 209 && ( $post_type_object->show_ui || 'attachment' == $current_object->post_type ) ) 210 { 211 $wp_admin_bar->add_menu( array( 212 'id' => 'edit', 213 'title' => $post_type_object->labels->edit_item, 214 'href' => get_edit_post_link( $current_object->ID ) 215 ) ); 216 } elseif ( ! empty( $current_object->taxonomy ) 217 && ( $tax = get_taxonomy( $current_object->taxonomy ) ) 218 && current_user_can( $tax->cap->edit_terms ) 219 && $tax->show_ui ) 220 { 221 $wp_admin_bar->add_menu( array( 222 'id' => 'edit', 223 'title' => $tax->labels->edit_item, 224 'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) 225 ) ); 226 } 172 227 } 173 228 } 174 229 -
wp-includes/taxonomy.php
404 404 'parent_item' => array( null, __( 'Parent Category' ) ), 405 405 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), 406 406 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), 407 'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ), 407 408 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), 408 409 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), 409 410 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), -
wp-includes/class-wp-admin-bar.php
180 180 181 181 function add_menus() { 182 182 add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 ); 183 add_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 15 ); 183 184 add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 184 185 add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 ); 185 186 add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); -
wp-admin/includes/class-wp-terms-list-table.php
261 261 } 262 262 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 263 263 $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>"; 264 $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>'; 264 265 265 266 $actions = apply_filters( 'tag_row_actions', $actions, $tag ); 266 267 $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );