getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Update tanlinell_has_children #319

Closed neilberry001 closed 10 years ago

neilberry001 commented 10 years ago

i dont think it currently works properly, think you have to pass it an ID

function tanlinell_has_children( $post = false ) {

    $post = ( false == $post ) ? get_post() : ( is_int( $post ) ) ? get_post( $post ) : $post ;

    $pages = get_pages('child_of=' . $post->ID);

    return ( 0 == count($pages) ) ? false : true;

}