/** * Setup Template Layout. * * @since 1.0.0 * @access public * @param object $template Post Object. */ public function setup_layout($template) { if (!is_object($template)) { return; } $this->layout_id = $template->ID; $this->layout_name = $template->post_name; $this->layout_content = $template->post_content; // get header option if ($template->tf_template_header_option) { $this->header = $template->tf_template_header_option; } // get header option if ($template->tf_template_sidebar_option) { $this->sidebar = $template->tf_template_sidebar_option; } // get footer option if ($template->tf_template_footer_option) { $this->footer = $template->tf_template_footer_option; } // get type option if ($template->tf_template_type) { $this->type = $template->tf_template_type; } $this->region_header = empty($template->tf_template_region_header) ? TF_Model::get_template_region_meta($template->ID, 'header') : sprintf('[tf_template_part slug="%s"]', $template->tf_template_region_header); $this->region_sidebar = empty($template->tf_template_region_sidebar) ? TF_Model::get_template_region_meta($template->ID, 'sidebar') : sprintf('[tf_template_part slug="%s"]', $template->tf_template_region_sidebar); $this->region_footer = empty($template->tf_template_region_footer) ? TF_Model::get_template_region_meta($template->ID, 'footer') : sprintf('[tf_template_part slug="%s"]', $template->tf_template_region_footer); add_filter('body_class', array($this, 'body_class'), 10); }