/** * Register Admin Menu * * @return void * * @access public */ public function adminMenu() { if (AAM_Core_Console::hasIssues()) { $counter = ' <span class="update-plugins">' . '<span class="plugin-count">' . AAM_Core_Console::count() . '</span></span>'; } else { $counter = ''; } //register the menu add_menu_page(__('AAM', AAM_KEY), __('AAM', AAM_KEY) . $counter, AAM_Core_ConfigPress::get('aam.page.capability', 'administrator'), 'aam', array($this, 'renderPage'), AAM_MEDIA . '/active-menu.png'); }
/** * Reject the request * * Redirect or die the execution based on ConfigPress settings * * @return void * * @access public */ public static function reject() { $redirect = AAM_Core_ConfigPress::get('frontend.access.deny.redirect'); if (filter_var($redirect, FILTER_VALIDATE_URL)) { wp_redirect($redirect); } elseif (is_int($redirect)) { wp_redirect(get_post_permalink($redirect)); } else { $message = AAM_Core_ConfigPress::get('frontend.access.deny.message', __('Access Denied', AAM_KEY)); wp_die($message); } exit; }
/** * * @return type */ public function getBasedir() { $basedir = WP_CONTENT_DIR . self::RELPATH; return AAM_Core_ConfigPress::get('aam.extentionDir', $basedir); }
/** * Check if current user can use feature * * Make sure that current user has enough capabilities to use feature * * @param string $feature * @param string $cap * * @return boolean * * @access protected * @static */ protected static function accessGranted($feature, $cap = 'administrator') { $capability = AAM_Core_ConfigPress::get("aam.feature.{$feature}.capability", $cap); return current_user_can($capability); }
/** * Control edit permalink feature * * @param string $html * * @return string */ public function permalinkHTML($html) { if (AAM_Core_ConfigPress::get('aam.control_permalink') === 'true') { if (AAM::getUser()->hasCapability('manage_permalink') === false) { $html = ''; } } return $html; }