Move taxonomy object properties for capabilities into a cap object. Capabilities can be specified via ['capabilities'] (an array keyed by the generic cap name) for register_taxonomy. fixes #13358.

git-svn-id: https://develop.svn.wordpress.org/trunk@14593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-13 04:10:17 +00:00
parent 39edf881e0
commit 4f689c8309
11 changed files with 41 additions and 38 deletions
+2 -2
View File
@@ -646,7 +646,7 @@ function get_tag_feed_link($tag_id, $feed = '') {
function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) {
global $post_type;
$tax = get_taxonomy($taxonomy);
if ( !current_user_can($tax->edit_cap) )
if ( !current_user_can($tax->cap->edit_terms) )
return;
$tag = get_term($tag_id, $taxonomy);
@@ -668,7 +668,7 @@ function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) {
*/
function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
$tax = get_taxonomy('post_tag');
if ( !current_user_can($tax->edit_cap) )
if ( !current_user_can($tax->cap->edit_terms) )
return;
$tag = get_term($tag, 'post_tag');