🔵 other: Start page children block upgrade

This commit is contained in:
Keith Solomon
2025-09-26 08:46:53 -05:00
parent b6f14e6809
commit 7402826f3d
2 changed files with 42 additions and 26 deletions

View File

@@ -8,8 +8,24 @@
namespace BasicWP;
// Retrieve the current page ID and its children
$currentPageId = get_the_ID();
$currentPageChildren = get_pages( array( 'child_of' => $currentPageId ) );
$parentId = get_queried_object_id();
// Children: direct descendants only
$children = get_posts(
array(
'post_type' => 'page',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => array(
'menu_order' => 'ASC',
'title' => 'ASC',
),
'order' => 'ASC',
'post_parent' => $parentId,
'fields' => 'all',
'no_found_rows' => true,
)
);
// Set classes
$classes = 'page-children';