/**
  * Page Type Breaker
  *
  * Returns template type based on WordPress conditionals
  *
  * @return mixed|void
  */
 public function page_type_breaker()
 {
     global $post;
     global $pl_integration;
     if (pl_is_integration()) {
         $type = pl_get_integration();
     } elseif (is_404()) {
         $type = '404_page';
     } elseif (pl_is_cpt('archive')) {
         $type = get_post_type_plural();
     } elseif (pl_is_cpt()) {
         $type = get_post_type();
     } elseif (is_tag() && VPRO) {
         $type = 'tag';
     } elseif (is_search() && VPRO) {
         $type = 'search';
     } elseif (is_category() && VPRO) {
         $type = 'category';
     } elseif (is_author() && VPRO) {
         $type = 'author';
     } elseif (is_archive() && VPRO) {
         $type = 'archive';
     } elseif (is_home() || !VPRO && is_pagelines_special()) {
         $type = 'posts';
     } elseif (is_page_template()) {
         /** Strip the page. and .php from page.[template-name].php */
         $page_filename = str_replace('.php', '', get_post_meta($post->ID, '_wp_page_template', true));
         $template_name = str_replace('page.', '', $page_filename);
         $type = $template_name;
     } elseif (is_single()) {
         $type = 'single';
     } else {
         $type = 'default';
     }
     return apply_filters('pagelines_page_type', $type, $post);
 }
示例#2
0
 /**
  *
  * @TODO document
  *
  */
 function load_sections_for_type($sections, $template_type, $hook)
 {
     if ($template_type == $this->id || $template_type == get_post_type_plural($this->id)) {
         return $this->settings['load_sections'];
     } else {
         return $sections;
     }
 }