Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: 'GET',
- url: myapi.myapi_url + '/posts',
- beforeSend:function(xhr){
- xhr.setRequestHeader('X-WP-Nonce', myapi.nonce);
- },
- data: {
- post_type: params.post_type
- },
- success:function(data){
- console.log(data);
- },
- error:function(data){
- console.log(data);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement