From ce0590be8cc4f587b95d5fb9ff8e5e7bde9059a4 Mon Sep 17 00:00:00 2001 From: dd32 Date: Fri, 19 Feb 2010 09:33:50 +0000 Subject: [PATCH] More Taxonomy cap checks. See #12035 git-svn-id: http://svn.automattic.com/wordpress/trunk@13212 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 340335f1e..5cd2a299d 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -619,10 +619,11 @@ function get_tag_feed_link($tag_id, $feed = '') { * @return string */ function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) { - $tag = get_term($tag_id, $taxonomy); - - if ( !current_user_can('manage_categories') ) + $tax = get_taxonomy($taxonomy); + if ( !current_user_can($tax->edit_cap) ) return; + + $tag = get_term($tag_id, $taxonomy); $location = admin_url('edit-tags.php?action=edit&taxonomy=' . $taxonomy . '&tag_ID=' . $tag->term_id); return apply_filters( 'get_edit_tag_link', $location ); @@ -640,11 +641,12 @@ function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) { * @return string|null HTML content, if $echo is set to false. */ function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) { - $tag = get_term($tag, 'post_tag'); - - if ( !current_user_can('manage_categories') ) + $tax = get_taxonomy('post_tag'); + if ( !current_user_can($tax->edit_cap) ) return; + $tag = get_term($tag, 'post_tag'); + if ( empty($link) ) $link = __('Edit This');