public function __construct($sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework') { parent::__construct($sOptionKey, $sCallerPath, $sCapability, $sTextDomain); if ($this->oProp->bIsAdminAjax) { return; } if (!$this->oProp->bIsAdmin) { return; } add_action("load_after_{$this->oProp->sClassName}", array($this, '_replyToRegisterSettings'), 20); add_action("load_after_{$this->oProp->sClassName}", array($this, '_replyToCheckRedirects'), 21); if (isset($_GET['apf_action'], $_GET['transient']) && 'email' === $_GET['apf_action']) { ignore_user_abort(true); $this->oUtil->registerAction('plugins_loaded', array($this, '_replyToSendFormEmail')); } if (isset($_REQUEST['apf_remote_request_test']) && '_testing' === $_REQUEST['apf_remote_request_test']) { exit('OK'); } }
/** * Registers necessary hooks and sets up properties. * * @internal * @since 3.3.0 * @since 3.3.1 Moved from `AdminPageFramework_Setting_Base`. */ function __construct($sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework') { parent::__construct($sOptionKey, $sCallerPath, $sCapability, $sTextDomain); if ($this->oProp->bIsAdminAjax) { return; } if (!$this->oProp->bIsAdmin) { return; } add_action("load_after_{$this->oProp->sClassName}", array($this, '_replyToRegisterSettings'), 20); add_action("load_after_{$this->oProp->sClassName}", array($this, '_replyToCheckRedirects'), 21); // should be loaded after registering the settings. // Form emails. if (isset($_GET['apf_action'], $_GET['transient']) && 'email' === $_GET['apf_action']) { // Set the server not to abort even the client browser terminates. ignore_user_abort(true); // wp_mail() will be loaded by the time 'plugins_loaded' is loaded. $this->oUtil->registerAction('plugins_loaded', array($this, '_replyToSendFormEmail')); } // Get and post method checking. if (isset($_REQUEST['apf_remote_request_test']) && '_testing' === $_REQUEST['apf_remote_request_test']) { exit('OK'); } }