protected function isApplicableContext(array $notice): bool
    {
        if ($this->Wp->is_network_admin) {
            $context = 'network';
        } elseif ($this->Wp->is_user_admin) {
            $context = 'user';
        } elseif ($this->Wp->is_admin) {
            $context = 'admin';
        } else { // Should not happen, but just in case.
            debug(0, $this->c::issue(vars(), 'Context unknown.'));
            return false; // Unknown w/ debugger.
        }
        $notice                  = $this->normalize($notice);
        $applicable_contexts     = preg_split('/[|\s]+/u', $notice['for_context'], -1, PREG_SPLIT_NO_EMPTY);
        $not_applicable_contexts = preg_split('/[|\s]+/u', $notice['not_for_context'], -1, PREG_SPLIT_NO_EMPTY);
        // e.g., `network|admin`, `network || admin`, or `network admin`.

        if ($applicable_contexts && !in_array($context, $applicable_contexts, true)) {
            return false; // Not applicable in this context.
        } elseif ($not_applicable_contexts && in_array($context, $not_applicable_contexts, true)) {
            return false; // Not applicable in this context.
        }
        return true; // Applicable context (default behavior).
    }
protected function isApplicableContext(array $notice): bool
    {
        if ($this->Wp->is_network_admin) {
            $context = 'network';
        } elseif ($this->Wp->is_user_admin) {
            $context = 'user';
        } elseif ($this->Wp->is_admin) {
            $context = 'admin';
        } else { // Should not happen, but just in case.
            debug(0, $this->c::issue(vars(), 'Context unknown.'));
            return false; // Unknown w/ debugger.
        }
        $notice                  = $this->normalize($notice);
        $applicable_contexts     = preg_split('/[|\s]+/u', $notice['for_context'], -1, PREG_SPLIT_NO_EMPTY);
        $not_applicable_contexts = preg_split('/[|\s]+/u', $notice['not_for_context'], -1, PREG_SPLIT_NO_EMPTY);
        // e.g., `network|admin`, `network || admin`, or `network admin`.

        if ($applicable_contexts && !in_array($context, $applicable_contexts, true)) {
            return false; // Not applicable in this context.
        } elseif ($not_applicable_contexts && in_array($context, $not_applicable_contexts, true)) {
            return false; // Not applicable in this context.
        }
        return true; // Applicable context (default behavior).
    }
protected function isApplicableContext ( array $ notice ) : bool { if ( $ this -> Wp -> is_network_admin ) { $ context = 'network' ; } elseif ( $ this -> Wp -> is_user_admin ) { $ context = 'user' ; } elseif ( $ this -> Wp -> is_admin ) { $ context = 'admin' ; } else { // Should not happen, but just in case. debug ( 0 , $ this -> c :: issue ( vars ( ) , 'Context unknown.' ) ) ; return false ; // Unknown w/ debugger. } $ notice = $ this -> normalize ( $ notice ) ; $ applicable_contexts = preg_split ( '/[|\s]+/u' , $ notice [ 'for_context' ] , - 1 , PREG_SPLIT_NO_EMPTY ) ; $ not_applicable_contexts = preg_split ( '/[|\s]+/u' , $ notice [ 'not_for_context' ] , - 1 , PREG_SPLIT_NO_EMPTY ) ; // e.g., `network|admin`, `network || admin`, or `network admin`. if ( $ applicable_contexts && ! in_array ( $ context , $ applicable_contexts , true ) ) { return false ; // Not applicable in this context. } elseif ( $ not_applicable_contexts && in_array ( $ context , $ not_applicable_contexts , true ) ) { return false ; // Not applicable in this context. } return true ; // Applicable context (default behavior). }
Is an applicable context?

@since 160715 Notice contexts.

@param array $notice Input notice.

@return bool True if an applicable context.
Is an applicable context?