Themosis\Route\Route::parameters PHP Method

parameters() public method

Get the key / value list of parameters for the route.
public parameters ( ) : array
return array
    public function parameters()
    {
        if ($this->condition) {
            global $post, $wp_query;
            // Pass WordPress globals to closures or controller methods as parameters.
            $parameters = array_merge($this->parameters, ['post' => $post, 'query' => $wp_query]);
            // When no posts, $post is null.
            // When is null, set the parameter value of $post to false.
            // This avoid missing arguments in methods for routes or controllers.
            if (is_null($parameters['post'])) {
                $parameters['post'] = false;
            }
            $this->parameters = $parameters;
            return $parameters;
        }
        return parent::parameters();
    }