2019-07-17 16:55:09 +03:00
|
|
|
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
|
|
|
|
|
|
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
2018-10-08 23:36:05 +03:00
|
|
|
//Only for AJAX loading posts
|
|
|
|
|
if ( ! empty( $posts ) ) {
|
|
|
|
|
foreach ( $posts as $post ) {
|
2019-10-17 16:20:48 +03:00
|
|
|
UM()->get_template( 'profile/posts-single.php', '', array( 'post' => $post ), true );
|
2018-10-08 23:36:05 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ( ! empty( $posts ) ) { ?>
|
|
|
|
|
<div class="um-ajax-items">
|
2015-11-16 22:40:15 +08:00
|
|
|
|
2018-10-08 23:36:05 +03:00
|
|
|
<?php foreach ( $posts as $post ) {
|
2019-10-17 16:20:48 +03:00
|
|
|
UM()->get_template( 'profile/posts-single.php', '', array( 'post' => $post ), true );
|
2018-10-08 23:36:05 +03:00
|
|
|
}
|
2015-02-01 01:30:04 +02:00
|
|
|
|
2018-10-08 23:36:05 +03:00
|
|
|
if ( $count_posts > 10 ) { ?>
|
|
|
|
|
<div class="um-load-items">
|
2019-08-08 00:36:33 +03:00
|
|
|
<a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_posts"
|
|
|
|
|
data-author="<?php echo esc_attr( um_get_requested_user() ); ?>" data-page="1"
|
|
|
|
|
data-pages="<?php echo esc_attr( ceil( $count_posts / 10 ) ); ?>">
|
2018-10-08 23:36:05 +03:00
|
|
|
<?php _e( 'load more posts', 'ultimate-member' ); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
2018-03-02 09:55:49 +02:00
|
|
|
|
2018-10-08 23:36:05 +03:00
|
|
|
</div>
|
2018-03-02 09:55:49 +02:00
|
|
|
|
2018-10-08 23:36:05 +03:00
|
|
|
<?php } else { ?>
|
2015-02-01 01:30:04 +02:00
|
|
|
|
2018-10-08 23:36:05 +03:00
|
|
|
<div class="um-profile-note">
|
|
|
|
|
<span>
|
2019-08-08 00:36:33 +03:00
|
|
|
<?php if ( um_profile_id() == get_current_user_id() ) {
|
|
|
|
|
_e( 'You have not created any posts.', 'ultimate-member' );
|
|
|
|
|
} else {
|
|
|
|
|
_e( 'This user has not created any posts.', 'ultimate-member' );
|
|
|
|
|
} ?>
|
2018-10-08 23:36:05 +03:00
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php }
|
|
|
|
|
}
|