/** * @return mixed */ public function getOption() { if ($this->_optionValue === null) { $option = IfwPsn_Wp_Proxy_Screen::getOption('per_page', 'option'); $value = IfwPsn_Wp_Proxy_User::getCurrentUserMetaSingle($option); if (method_exists($this, '_getOptionCallback')) { $value = $this->_getOptionCallback($value); } $this->_optionValue = $value; } return $this->_optionValue; }
/** * @param $value * @return null */ protected function _getOptionCallback($value) { if (empty($value) || $value < 1) { $value = IfwPsn_Wp_Proxy_Screen::getOption('per_page', 'default'); } return (int) $value; }