/** * is_pagelines_special() REVISED * * A few conditional functions that were being used were unnecessary * (is_author, is_category, & is_tag) as these are all covered by is_archive * * $special_types should be a filterable array to allow ploption to be used for extended special option values, * or anytime the passed $args['type'] would be used/compared (in admin) * * Filterable return value - could be used for example to return false for the blog home, * letting the page meta values take precedence instead of the special. Just a thought. * */ function is_pagelines_special($args = array()) { $special_types = apply_filters('pagelines_special_types', array('posts', 'archive', 'category', 'search', 'tag', 'author', '404_page')); if (is_404() || is_home() || is_search() || is_archive()) { $special = true; } elseif (isset($args['type']) && in_array($args['type'], $special_types)) { $special = true; } elseif (pl_is_integration()) { $special = true; } else { $special = false; } return apply_filters('is_pagelines_special', $special, $args); }
/** * 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); }