🔵 other: Start page children block upgrade
This commit is contained in:
@@ -8,8 +8,24 @@
|
|||||||
namespace BasicWP;
|
namespace BasicWP;
|
||||||
|
|
||||||
// Retrieve the current page ID and its children
|
// Retrieve the current page ID and its children
|
||||||
$currentPageId = get_the_ID();
|
$parentId = get_queried_object_id();
|
||||||
$currentPageChildren = get_pages( array( 'child_of' => $currentPageId ) );
|
|
||||||
|
// 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
|
// Set classes
|
||||||
$classes = 'page-children';
|
$classes = 'page-children';
|
||||||
|
|||||||
Reference in New Issue
Block a user