How to show tags from private posts for users with rights

Аdd following modifications:
Index: wp-includes/category-template.php

+++ wp-includes/category-template.php (working copy)
@@ -526,7 +526,12 @@
);
$args = wp_parse_args( $args, $defaults );

+ if (current_user_can("read_private_posts")) {
+ $tags = get_terms( $args['taxonomy'], array_merge($args, array('hide_empty' => 0, 'orderby' => 'count', 'order ' => 'DESC')) ); // Always query top tags
+ }
+ else {
$tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
+ }

if ( empty( $tags ) || is_wp_error( $tags ) )
return;

Leave a Reply

  

  

  

www.000webhost.com