From 249da10ef7534917bc190cf0ce5d3eb9dcd28793 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 19 Feb 2010 09:33:50 +0000 Subject: [PATCH] More Taxonomy cap checks. See #12035 git-svn-id: https://develop.svn.wordpress.org/trunk@13212 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 340335f1ea..5cd2a299d7 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');