function type() { global $pl_404; if (is_404() && $pl_404) { $type = '404_page'; } elseif (is_post_type_archive()) { $type = pl_get_post_type_plural(); } elseif (is_tag()) { $type = 'tag'; } elseif (is_search()) { $type = 'search'; } elseif (is_category()) { $type = 'category'; } elseif (is_author()) { $type = 'author'; } elseif (is_archive()) { $type = 'archive'; } elseif (is_home()) { $type = 'blog'; } elseif (pl_is_cpt()) { $type = get_post_type(); } elseif (is_page()) { $type = 'page'; } elseif (is_single()) { $type = 'post'; } else { $type = 'other'; } return $type; }
/** * * @TODO document * */ function load_sections_for_type($sections, $template_type, $hook) { if ($template_type == $this->id || $template_type == pl_get_post_type_plural($this->id)) { return $this->settings['load_sections']; } else { return $sections; } }