public function onWpLoaded()
    {
        if ($this->c::isCli()) {
            return; // Not applicable.
        } elseif (empty($_REQUEST[$this->var])) {
            return; // Not applicable.
        }
        $this->action = (string) $_REQUEST[$this->var];
        $this->action = $this->c::unslash($this->action);
        $this->action = $this->c::mbTrim($this->action);

        $this->c::noCacheFlags(); // Flag as do NOT cache.
        $this->c::noCacheHeaders(); // Send headers also.

        if ($this->viaAjax($this->action)) {
            header('content-type: application/json; charset=utf-8');
            $this->c::isAjax(true);
        } elseif ($this->viaApi($this->action)) {
            header('content-type: application/json; charset=utf-8');
            $this->api_version = $this->parseApiVersion($this->action);
            $this->action      = $this->stripApiVersion($this->action);
            $this->c::isApi(true);
        }
        $this->c::doingRestAction($this->action); // w/o API version.

        if (!isset($this->registered_actions[$this->action])) {
            $this->s::dieInvalid(); // Unregistered!
        }
        $actor = $this->registered_actions[$this->action];

        if ($actor['requires_valid_nonce']) {
            $this->s::requireValidNonce($this->action);
        }
        $Utility = $this->App->Utils->{$actor['class']};
        $Utility->{$actor['method']}($this->action);
    }
public function onWpLoaded()
    {
        if ($this->c::isCli()) {
            return; // Not applicable.
        } elseif (empty($_REQUEST[$this->var])) {
            return; // Not applicable.
        }
        $this->action = (string) $_REQUEST[$this->var];
        $this->action = $this->c::unslash($this->action);
        $this->action = $this->c::mbTrim($this->action);

        $this->c::noCacheFlags(); // Flag as do NOT cache.
        $this->c::noCacheHeaders(); // Send headers also.

        if ($this->viaAjax($this->action)) {
            header('content-type: application/json; charset=utf-8');
            $this->c::isAjax(true);
        } elseif ($this->viaApi($this->action)) {
            header('content-type: application/json; charset=utf-8');
            $this->api_version = $this->parseApiVersion($this->action);
            $this->action      = $this->stripApiVersion($this->action);
            $this->c::isApi(true);
        }
        $this->c::doingRestAction($this->action); // w/o API version.

        if (!isset($this->registered_actions[$this->action])) {
            $this->s::dieInvalid(); // Unregistered!
        }
        $actor = $this->registered_actions[$this->action];

        if ($actor['requires_valid_nonce']) {
            $this->s::requireValidNonce($this->action);
        }
        $Utility = $this->App->Utils->{$actor['class']};
        $Utility->{$actor['method']}($this->action);
    }
public function onWpLoaded ( ) { if ( $ this -> c :: isCli ( ) ) { return ; // Not applicable. } elseif ( empty ( $ _REQUEST [ $ this -> var ] ) ) { return ; // Not applicable. } $ this -> action = ( string ) $ _REQUEST [ $ this -> var ] ; $ this -> action = $ this -> c :: unslash ( $ this -> action ) ; $ this -> action = $ this -> c :: mbTrim ( $ this -> action ) ; $ this -> c :: noCacheFlags ( ) ; // Flag as do NOT cache. $ this -> c :: noCacheHeaders ( ) ; // Send headers also. if ( $ this -> viaAjax ( $ this -> action ) ) { header ( 'content-type: application/json; charset=utf-8' ) ; $ this -> c :: isAjax ( true ) ; } elseif ( $ this -> viaApi ( $ this -> action ) ) { header ( 'content-type: application/json; charset=utf-8' ) ; $ this -> api_version = $ this -> parseApiVersion ( $ this -> action ) ; $ this -> action = $ this -> stripApiVersion ( $ this -> action ) ; $ this -> c :: isApi ( true ) ; } $ this -> c :: doingRestAction ( $ this -> action ) ; // w/o API version. if ( ! isset ( $ this -> registered_actions [ $ this -> action ] ) ) { $ this -> s :: dieInvalid ( ) ; // Unregistered! } $ actor = $ this -> registered_actions [ $ this -> action ] ; if ( $ actor [ 'requires_valid_nonce' ] ) { $ this -> s :: requireValidNonce ( $ this -> action ) ; } $ Utility = $ this -> App -> Utils -> { $ actor [ 'class' ] } ; $ Utility -> { $ actor [ 'method' ] } ( $ this -> action ) ; }
On `wp_loaded` hook.

@since 160608 ReST utils.
On wp_loaded hook .