• Hi everyone,

    I am creating my own rest route and want to pass some variables to the permission callback function. This is the register_rest_route that I have to date:

    
            register_rest_route('1.00', '/trial/confirm', array(
                'methods' => 'POST',
                'callback' => array($trial_service, 'callback_confirm'),
                'permission_callback' => array($this, 'check_permission_master'),
                'args' => array(
                    'token' => array(
                        'required' => true,
                        'sanitize_callback' => 'esc_attr'
                    )
                )
            ));

    How can I pass variables to check_permission_master ? Any help much appreciated. Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Register Rest Route with args’ is closed to new replies.