Slide 17
Slide 17 text
Updating Content
$.ajax( {
url: wpApiSettings.root + 'wp/v2/posts/1',
method: 'POST',
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', wpApiSettings.nonce );
},
data:{
'title' : 'Updated Moon',
'content': 'even better post'
}
} ).done( function ( response ) {
console.log( response );
} );