用户公开主页全局采用DOM无刷新加载

This commit is contained in:
kate522 committed 2026-08-23 14:55:24 +08:00
1 parent c3f66e9a14
commit bb9a410ad6
14 files changed
+569 -231

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
<?php
/**
* Public user home — posts tab panel body.
*
* Rendered inside the #panel-posts wrapper on the public user home and via
* the aksrt/v1 user-home panel REST fragment. Pagination is button-driven
* (aksrt_render_user_home_pagination) and never touches the URL.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$args = is_array($args ?? null) ? $args : [];
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
$user_home_render_config = aksrt_resolve_post_list_render_config([
'context' => 'author',
'overrides' => [
'type' => 'list',
'no_author' => true,
'no_margin' => true,
],
]);
$author_posts = new WP_Query([
'author' => $user_id,
'posts_per_page' => $per_page,
'post_status' => 'publish',
'paged' => $posts_page,
'no_found_rows' => false,
]);
aksrt_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'aksrt-user-home__post-list']), $author_posts);
aksrt_render_user_home_pagination((int) $author_posts->max_num_pages, (int) $posts_page);
wp_reset_postdata();