order by meta start_dato value (ACF)
order by meta start_dato value (ACF)
order by meta start_dato value (ACF)
Solution was simple. Set DOM element value in JS variable instead of “document.getElementById(‘post_category’).value” in array. var submitBtn = document.getElementById(‘submit-post-btn’); submitBtn.addEventListener(‘click’, function(){ var categoryTerm = document.getElementById(‘post_category’).value; var postData = { “title”: document.getElementById(‘post_title’).value, “content”: document.getElementById(‘post_content’).value, “status”: ‘publish’, “categories”: [categoryTerm] } };
Rest WP_Error always return null
How to upload multiple images using WP rest API to media?
In general, if you want totally headless application, you should not use wordpress but JS, as with JS you will be able to reuse at least some of the code for both server and client sides. As for using angular theme…. well the question is still why do you use wordpress at all as you … Read more
I solved it with mmm’s hint and created a simple custom REST endpoint. WP1 (Frontend, sending the data): function send_form_data_to_backend($form_values) { // add secret-key $form_values[‘secret_key’] = “abcde123″; $url=”http://backend.example.com/wp-json/example/v1/save/”; $response = wp_safe_remote_post( $url, array( ‘method’ => ‘POST’, ‘timeout’ => 15, ‘redirection’ => 5, ‘blocking’ => true, ‘headers’ => array(), ‘body’ => $form_values, ‘cookies’ => array() ) … Read more
Fetching users data from REST API
REST API Working for GET but not for POST?
Extending the API I created to return category names
Is it possible to combine two rest endpoints in the url?