Code includes var_dump() statement
By
UUA Web Team
September 8, 2017, 10:45 am EDT
While chasing down how the left sidebar menu was determined I discovered the following in …/uua-congregation/lib/content-nav.php:
function uuatheme_check_for_page_tree() {Note the existence of var_dump($parents); on line 19. This is decidedly not good practice. Is the intention to cease script execution and dump?
//start by checking if we’re on a page
if( is_page() ) {
global $post;
// next check if the page has parents
if ( $post->post_parent ){
// fetch the list of ancestors
$parents = array_reverse( get_post_ancestors( $post->ID ) );
var_dump($parents);
// get the top level ancestor
return $parents[0];
}
// return the id — this will be the topmost ancestor if there is one, or the current page if not
return $post->ID;
}