🔵 other: Start page children block upgrade
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user