has_parent() ) { $par = $thm->get_parent(); // Add ancestor if ( $par->is_valid() && ! in_array( $par, $ret, true ) ) { $ret[] = $par; } // Get next ancestor $thm = $par; } // Sorting if ( $sort_topdown ) { $ret = array_reverse( $ret ); } return $ret; } /** * Set public flag * @param bool $public */ public function set_public( $public ) { $this->public = ! ! $public; } /** * Get privacy state * @return bool */ public function get_public() { return ! ! $this->public; } /* Templates */ /** * Add template file * @see `add_file()` * @param string $handle Template handle * @param string $src Template URI * @return obj Current instance */ protected function add_template( $handle, $src ) { return $this->add_file( 'template', $handle, $src ); } /** * Retrieve template file * @see `get_file()` * @param string $handle Template handle * @param string $format (optional) Return value format * @return mixed Template file (Default: array of file properties @see `Base_Object::add_file()`) */ protected function get_template( $handle, $format = null ) { return $this->get_file( 'template', $handle, $format ); } /* Layout */ /** * Set theme layout * @uses `add_template()` * @param string $src Layout file URI * @return Current instance */ public function set_layout( $src ) { return $this->add_template( 'layout', $src ); } /** * Get layout * @param string $format (optional) Layout data format * @return mixed Theme layout */ public function get_layout( $format = null ) { return $this->get_template( 'layout', $format ); } }