Example #1
0
/**
 * This function redirects the user to an admin page, and adds query args
 * to the URL string for alerts, etc.
 *
 * @since 0.1.0
 */
function accesspress_admin_redirect($page = '', $query_args = array())
{
    premise_admin_redirect($page, $query_args);
}
Example #2
0
 /**
  * Register the database settings for storage.
  *
  * @since 0.1.0
  *
  * @return null Returns early if not on the correct admin page
  */
 public function register_settings()
 {
     /** If this page doesn't store settings, no need to register them */
     if (!$this->settings_field) {
         return;
     }
     register_setting($this->settings_field, $this->settings_field);
     if (false === get_option($this->settings_field)) {
         add_option($this->settings_field, $this->default_settings);
     }
     if (!accesspress_is_menu_page($this->page_id)) {
         return;
     }
     if (premise_get_option('reset', $this->settings_field)) {
         update_option($this->settings_field, $this->default_settings);
         premise_admin_redirect($this->page_id, array('reset' => 'true'));
         exit;
     }
 }