function get_content()
 {
     return pods_content();
 }
function render_content()
{
    pods_content();
}
Exemple #3
0
 /**
  *
  */
 public function template_redirect()
 {
     global $pods;
     if (false !== self::$exists) {
         /*
          * Create pods.php in your theme directory, and
          * style it to suit your needs. Some helpful functions:
          *
          * get_header()
          * pods_content()
          * get_sidebar()
          * get_footer()
          */
         $template = self::$exists['page_template'];
         $template = apply_filters('pods_page_template', $template, self::$exists);
         $render_function = apply_filters('pods_template_redirect', null, $template, self::$exists);
         do_action('pods_page', $template, self::$exists);
         if ('_custom' == $template) {
             pods_content();
         } elseif (null !== $render_function && is_callable($render_function)) {
             call_user_func($render_function, $template, self::$exists);
         } elseif ((!defined('PODS_DISABLE_DYNAMIC_TEMPLATE') || !PODS_DISABLE_DYNAMIC_TEMPLATE) && is_object($pods) && !is_wp_error($pods) && isset($pods->page_template) && !empty($pods->page_template) && '' != locate_template(array($pods->page_template), true)) {
             $template = $pods->page_template;
             // found the template and included it, we're good to go!
         } elseif (!empty(self::$exists['page_template']) && '' != locate_template(array(self::$exists['page_template']), true)) {
             $template = self::$exists['page_template'];
             // found the template and included it, we're good to go!
         } else {
             $default_templates = array();
             $uri = explode('?', self::$exists['uri']);
             $uri = explode('#', $uri[0]);
             $page_path = explode('/', $uri[0]);
             while ($last = array_pop($page_path)) {
                 $file_name = str_replace('*', '-w-', implode('/', $page_path) . '/' . $last);
                 $sanitized = sanitize_title($file_name);
                 $default_templates[] = 'pods/' . trim(str_replace('--', '-', $sanitized), ' -') . '.php';
                 $default_templates[] = 'pods-' . trim(str_replace('--', '-', $sanitized), ' -') . '.php';
             }
             $default_templates[] = 'pods.php';
             $default_templates = apply_filters('pods_page_default_templates', $default_templates);
             $template = locate_template($default_templates, true);
             if ('' != $template) {
                 // found the template and included it, we're good to go!
             } else {
                 $template = false;
                 // templates not found in theme, default output
                 do_action('pods_page_default', $template, self::$exists);
                 get_header();
                 pods_content();
                 get_sidebar();
                 get_footer();
             }
         }
         do_action('pods_page_end', $template, self::$exists);
         exit;
     }
 }
Exemple #4
0
 function template_redirect()
 {
     global $pods, $pod_page_exists;
     if (false !== $pod_page_exists) {
         /*
          * Create pods.php in your theme directory, and
          * style it to suit your needs. Some helpful functions:
          *
          * get_header()
          * pods_content()
          * get_sidebar()
          * get_footer()
          */
         $template = $pod_page_exists['page_template'];
         $template = apply_filters('pods_page_template', $template, $pod_page_exists);
         $render_function = apply_filters('pods_template_redirect', 'false', $template, $pod_page_exists);
         do_action('pods_page', $template, $pod_page_exists);
         if (is_callable($render_function)) {
             call_user_func($render_function);
         } elseif ((!defined('PODS_DISABLE_DYNAMIC_TEMPLATE') || !PODS_DISABLE_DYNAMIC_TEMPLATE) && is_object($pods) && !is_wp_error($pods) && isset($pods->page_template) && !empty($pods->page_template) && '' != locate_template(array($pods->page_template), true)) {
             $template = $pods->page_template;
             // found the template and included it, we're good to go!
         } elseif (!empty($pod_page_exists['page_template']) && '' != locate_template(array($pod_page_exists['page_template']), true)) {
             $template = $pod_page_exists['page_template'];
             // found the template and included it, we're good to go!
         } elseif ('' != locate_template(apply_filters('pods_page_default_templates', array('pods.php')), true)) {
             $template = 'pods.php';
             // found the template and included it, we're good to go!
         } else {
             // templates not found in theme, default output
             do_action('pods_page_default', $template, $pod_page_exists);
             get_header();
             pods_content();
             get_sidebar();
             get_footer();
         }
         do_action('pods_page_end', $template, $pod_page_exists);
         exit;
     }
 }