/** * Callback for WP >= 3.3 * @since WP 3.3 */ public function addHelpTab() { $screen = IfwPsn_Wp_Proxy_Screen::getCurrent(); $help = array('id' => $this->_id == null ? 1 : $this->_id, 'title' => $this->_title, 'content' => sprintf('<div class="ifw-help-tab-content">%s</div>', $this->_help)); IfwPsn_Wp_Proxy_Screen::addHelpTab($help); if (!empty($this->_sidebar)) { IfwPsn_Wp_Proxy_Screen::setHelpSidebar($this->_sidebar); } }
/** * @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; }
/** * Shortcut for add_action( 'admin_footer-*', 'function_name' ) * * @param $function_to_add * @param int $priority * @param int $accepted_args * @return bool|void */ public static function addAdminFooterCurrentScreen($function_to_add, $priority = 10, $accepted_args = 1) { $current = IfwPsn_Wp_Proxy_Screen::getCurrent(); if ($current instanceof WP_Screen) { return self::add('admin_footer-' . IfwPsn_Wp_Proxy_Screen::getCurrent()->id, $function_to_add, $priority, $accepted_args); } return false; }