List Pages Plugin

This WordPress plugin would check for empty content page and create list of links all children automatically.

See source code:

function listPagesFilterContent( $the_content ) {
	if ( strlen( trim( $the_content ) ) == 0 ) {
		$lp_post = $GLOBALS['post'];
		$args = array( 'child_of' => $lp_post->ID );
		wp_list_pages( $args );
	}
	return $the_content;
}

add_filter( 'the_content', 'listPagesFilterContent' );

See example

And you can also download it here: child-pages-plugin.zip

Leave a Reply