/** * Load a column * * $params['pod_id'] int The Pod ID * $params['id'] int The field ID * $params['name'] string The field name * * @param array $params An associative array of parameters * @since 1.7.9 */ public function load_column($params) { pods_deprecated('PodsAPI::load_column', '2.0', 'PodsAPI::load_field'); return $this->obj->load_field($params); }
/** * Handle methods that have been deprecated * * @since 2.0 */ public function __call($name, $args) { $name = (string) $name; if (!isset($this->deprecated)) { require_once PODS_DIR . 'deprecated/classes/PodsAPI.php'; $this->deprecated = new PodsAPI_Deprecated($this); } if (method_exists($this->deprecated, $name)) { return call_user_func_array(array($this->deprecated, $name), $args); } else { pods_deprecated("PodsAPI::{$name}", '2.0'); } }
/** * Run any precode for current Pod Page */ public function precode() { global $pods; // Fix any global confusion wherever this runs if (isset($pods) && !isset($GLOBALS['pods'])) { $GLOBALS['pods'] =& $pods; } elseif (!isset($pods) && isset($GLOBALS['pods'])) { $pods =& $GLOBALS['pods']; } if (false !== self::$exists) { $permission = pods_permission(self::$exists['options']); $permission = (bool) apply_filters('pods_pages_permission', $permission, self::$exists); if ($permission) { $content = false; if (!is_object($pods) && 404 != $pods && 0 < strlen(pods_var('pod', self::$exists['options']))) { $slug = pods_var_raw('pod_slug', self::$exists['options'], null, null, true); // Handle special magic tags if (0 < strlen($slug)) { $slug = pods_evaluate_tags($slug, true); } $pods = pods(pods_var('pod', self::$exists['options']), $slug); // Auto 404 handling if item doesn't exist if (0 < strlen($slug) && !$pods->exists() && apply_filters('pods_pages_auto_404', true, $slug, $pods, self::$exists)) { $pods = 404; } } if (0 < strlen(trim(self::$exists['precode']))) { $content = self::$exists['precode']; } if (false !== $content && (!defined('PODS_DISABLE_EVAL') || !PODS_DISABLE_EVAL)) { pods_deprecated('Pod Page Precode has been deprecated, please use WP Page Templates or hook into the pods_content filter instead of embedding PHP.', '2.1'); eval("?>{$content}"); } do_action('pods_page_precode', self::$exists, $pods, $content); } elseif (self::$exists['options']['restrict_redirect']) { $redirect_url = ''; if (self::$exists['options']['restrict_redirect_login']) { $redirect_url = wp_login_url(pods_current_url()); } elseif (!empty(self::$exists['options']['restrict_redirect_url'])) { $redirect_url = self::$exists['options']['restrict_redirect_url']; } if (!empty($redirect_url)) { wp_redirect($redirect_url); die; } } if (!$permission || !is_object($pods) && (404 == $pods || is_wp_error($pods))) { remove_action('template_redirect', array($this, 'template_redirect')); remove_action('wp_head', array($this, 'wp_head')); remove_filter('redirect_canonical', '__return_false'); remove_filter('wp_title', array($this, 'wp_title')); remove_filter('body_class', array($this, 'body_class')); remove_filter('status_header', array($this, 'status_header')); remove_action('wp', array($this, 'silence_404'), 1); } } }
/** * Display the page template * * @deprecated deprecated since version 2.0 */ public function showTemplate($template_name, $code = null) { pods_deprecated('Pods::showTemplate', '2.0', 'Pods::template'); return $this->obj->template($template_name, $code, true); }
function __construct($type = null, $format = null) { pods_deprecated('PodAPI (class)', '2.0', 'pods_api (function)'); $this->new = pods_api($type, $format); }
/** * Handle methods that have been deprecated and any aliasing * * @var $name * @var $args * * @return mixed * * @since 2.0 */ public function __call($name, $args) { $name = (string) $name; // select > find alias if ('select' == $name) { return call_user_func_array(array($this, 'find'), $args); } if (!isset($this->deprecated)) { require_once PODS_DIR . 'deprecated/classes/Pods.php'; $this->deprecated = new Pods_Deprecated($this); } if (method_exists($this->deprecated, $name)) { return call_user_func_array(array($this->deprecated, $name), $args); } else { pods_deprecated("Pods::{$name}", '2.0'); } }
/** * Parse a template string * * @param string $code The template string to parse * @param object $obj The Pods object * * @since 1.8.5 */ public static function do_template($code, $obj = null) { if (!empty($obj)) { self::$obj =& $obj; } else { $obj =& self::$obj; } if (empty($obj) || !is_object($obj)) { return ''; } $code = trim($code); if (false !== strpos($code, '<?') && (!defined('PODS_DISABLE_EVAL') || !PODS_DISABLE_EVAL)) { pods_deprecated('Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3'); $code = str_replace('$this->', '$obj->', $code); ob_start(); eval("?>{$code}"); $out = ob_get_clean(); } else { $out = $code; } $out = $obj->do_magic_tags($out); return apply_filters('pods_templates_do_template', $out, $code, $obj); }
/** * Get value from array usage $object['offset']; * * @param mixed $offset Used to get value of Array * * @return mixed|null * * @since 2.3.10 */ public function offsetGet($offset) { if (!empty($this->_methods) && in_array($offset, $this->_methods)) { $value = call_user_func(array($this, $offset)); } elseif ('options' == $offset) { $value = null; if (pods_allow_deprecated()) { $value = $this->_object; } } elseif (isset($this->_object[$offset])) { $value = $this->_object[$offset]; if (!$this->_live) { // i18n plugin integration if ('label' == $offset || 0 === strpos($offset, 'label_')) { $value = __($value); } } } elseif (isset($this->_addtl[$offset])) { $value = $this->_addtl[$offset]; if (!$this->_live) { // i18n plugin integration if ('label' == $offset || 0 === strpos($offset, 'label_')) { $value = __($value); } } } elseif (isset($this->_deprecated_keys[$offset])) { $value = null; if (pods_allow_deprecated()) { $value = $this->offsetGet($this->_deprecated_keys[$offset]); } else { pods_deprecated('$object[\'' . $offset . '\']', '2.0', '$object[\'' . $this->_deprecated_keys[$offset] . '\']'); } } else { $value = $this->_meta($offset); if (null !== $value) { $this->_addtl[$offset] = $value; } } return $value; }
/** * Run any precode for current Pod Page */ public function precode() { global $pods; // Fix any global confusion wherever this runs if (isset($pods) && !isset($GLOBALS['pods'])) { $GLOBALS['pods'] =& $pods; } elseif (!isset($pods) && isset($GLOBALS['pods'])) { $pods =& $GLOBALS['pods']; } if (false !== self::$exists) { $permission = pods_permission(self::$exists['options']); $permission = (bool) apply_filters('pods_pages_permission', $permission, self::$exists); if ($permission) { $content = false; if (!is_object($pods) && 404 != $pods && 0 < strlen(pods_var('pod', self::$exists['options']))) { $pods = pods(pods_var('pod', self::$exists['options']), pods_evaluate_tags(pods_var_raw('pod_slug', self::$exists['options'], null, null, true), true)); } if (0 < strlen(trim(self::$exists['precode']))) { $content = self::$exists['precode']; } if (false !== $content && (!defined('PODS_DISABLE_EVAL') || !PODS_DISABLE_EVAL)) { pods_deprecated('Use WP Page Templates or hook into the pods_page_precode action instead of using Pod Page Precode', '2.1'); eval("?>{$content}"); } do_action('pods_page_precode', self::$exists, $pods, $content); } if (!$permission || !is_object($pods) && (404 == $pods || is_wp_error($pods))) { remove_action('template_redirect', array($this, 'template_redirect')); remove_action('wp_head', array($this, 'wp_head')); remove_filter('redirect_canonical', '__return_false'); remove_filter('wp_title', array($this, 'wp_title')); remove_filter('body_class', array($this, 'body_class')); remove_filter('status_header', array($this, 'status_header')); remove_action('wp', array($this, 'silence_404')); } } }