Skip to content

A jQuery wrapper around the WordPress REST API for use in any jQuery written web app.

Notifications You must be signed in to change notification settings

danillotuhumury/wp-rest-jquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

jQuery WordPress REST API Wrapper

This jQuery plugin provides a wrapper arround the WordPress REST API and can be used in any jQuery project.

Instalation

Simply copy the file into your project and replace YOUR_API_ENDPOINT with the correct URL. e.g. http://www.danillo.nl/wp-json/wp/v2

Usage

wp.posts()
	.done(function(posts){
		// Loop through the posts
		$(posts).each(function(){
			console.log(post.title.rendered);
			console.log(post.content.rendered);
		});
	})
	.fail(function(){
		console.log('Oops something went wrong');
	});
}

Documentation

For a more extended documentation go to the WordPress REST API Reference documentation at http://v2.wp-api.org/reference/

Posts

wp.posts([params])

Pages

wp.pages([params])

Media

wp.media([params])

Comments

wp.comments([params])

Categories

wp.categories([params])

Taxonomies

wp.taxonomies([params])

Tags

wp.tags([params])

Users

wp.users([params])

About

A jQuery wrapper around the WordPress REST API for use in any jQuery written web app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published