mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed posts query in the User Profile;
This commit is contained in:
@@ -1432,7 +1432,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
* @param \WP_Query $query
|
||||
*/
|
||||
function exclude_posts( $query ) {
|
||||
if ( $query->is_main_query() ) {
|
||||
if ( $query->is_main_query() || ! empty( $query->query_vars['um_main_query'] ) ) {
|
||||
$force = is_search() || is_admin();
|
||||
$exclude_posts = $this->exclude_posts_array( $force );
|
||||
if ( ! empty( $exclude_posts ) ) {
|
||||
|
||||
@@ -29,11 +29,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
|
||||
*/
|
||||
function add_posts() {
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'offset' => 0,
|
||||
'author' => um_get_requested_user(),
|
||||
'post_status' => array( 'publish' )
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'offset' => 0,
|
||||
'author' => um_get_requested_user(),
|
||||
'post_status' => array( 'publish' ),
|
||||
'um_main_query' => true,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -107,11 +108,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
|
||||
$page = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 0;
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'offset' => ( $page - 1 ) * 10,
|
||||
'author' => $author,
|
||||
'post_status' => array( 'publish' )
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'offset' => ( $page - 1 ) * 10,
|
||||
'author' => $author,
|
||||
'post_status' => array( 'publish' ),
|
||||
'um_main_query' => true,
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user