You’re not getting the TESTING
because your playlist
argument should actually be in the args
array like so: (reindented for brevity)
register_rest_route( SoundSystem::$rest_namespace, '/playlist/new', array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( __class__, 'rest_add_playlist' ),
'permission_callback' => function () {
return is_user_logged_in();
},
'args' => array(
'playlist' => array(
'description' => __( 'JSPF playlist data', 'soundsystem' ),
'type' => 'string',
'required' => true,
'sanitize_callback' => function($value, $request, $param) {
return 'TESTING';
},
),
), // end args
));