Authenticate current user to REST API
I solved my problem. This got me on the right track: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ You can just make an api call via frontend and jquery. $.ajax( { url: ‘<?php echo esc_url_raw( rest_url()) ?>’ + ‘your/endpoint’, method: ‘GET’, beforeSend: function ( xhr ) { xhr.setRequestHeader( ‘X-WP-Nonce’, ‘<?php echo wp_create_nonce( ‘wp_rest’)?>’ ); } } ).done( function ( response ) … Read more