Skip to content

Instantly share code, notes, and snippets.

@Jonnyauk
Created January 18, 2017 19:59
Show Gist options
  • Save Jonnyauk/dead3ac9c4c4218e4ebc1304fad347ca to your computer and use it in GitHub Desktop.
Save Jonnyauk/dead3ac9c4c4218e4ebc1304fad347ca to your computer and use it in GitHub Desktop.
function moomin2(){
$mypost = $post_ID = $p = (int) $_GET['post'];
//$target_id = wp_get_post_parent_id( get_the_ID() );
// Lets see if we have child pages to show
$p_child_args = array(
'parent' => intval( $mypost ),
'depth' => 1,
//'sort_order' => 'ASC',
//'sort_column' => 'menu_order', /* Things seem to go strange on siblings here */
'post_status' => 'publish',
'post_type' => 'page'
);
$p_children = get_pages( $p_child_args );
$child_ids = array();
foreach ( $p_children as $key => $value ) {
$child_ids[] = $value->ID;
}
wfx_debug($child_ids);
}
add_action('edit_page_form','moomin2');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment