- fixed getting posts count at the Posts tab;

- UM metatable queries changed;
This commit is contained in:
nikitasinelnikov
2020-01-10 12:53:30 +02:00
parent 2496825590
commit 731506be2b
4 changed files with 24 additions and 11 deletions
+7 -1
View File
@@ -60,7 +60,13 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
$args = apply_filters( 'um_profile_query_make_posts', $args );
$posts = get_posts( $args );
$count_posts = (int) count_user_posts( um_get_requested_user(), 'post', true );
$args['posts_per_page'] = -1;
$args['fields'] = 'ids';
unset( $args['offset'] );
$count_posts = get_posts( $args );
if ( ! empty( $count_posts ) && ! is_wp_error( $count_posts ) ) {
$count_posts = count( $count_posts );
}
UM()->get_template( 'profile/posts.php', '', array( 'posts' => $posts, 'count_posts' => $count_posts ), true );
}