4.0.4 • Published 2 months ago

@quickdevelopment/wp-js v4.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Installation

npm install @quickdevelopment/wp-js

Usage

Setting the Config

// src/main.ts
import { ConfigManager } from "@quickdevelopment/wp-js";

ConfigManager.getInstance({
    // Replace with your WordPress API URL
    apiUrl: 'https://developer.wordpress.org/wp-json/wp/v2',
    embed: true
});

Retrieve Posts

This is an example of how to retrieve posts from your WordPress site using the Post class.

import {Post, PostDataType} from "@quickdevelopment/wp-js";

const posts = new Post()

posts.fetch().then((posts: PostDataType[]) => {
  console.log(posts);
})
.catch((err) => {
  console.log(err);
});

Documentation

For more information about the library, see the documentation.

Coming up

  • Add more API classes to retrieve data from the WP API
  • Examples of how to use the library in multiple contexts
  • Add a documentation site

Contributing

If you want to contribute to this project, see CONTRIBUTING for details.

License

MIT © Quickdevelopment. See LICENSE for details.

4.0.4

2 months ago

4.0.3

2 months ago

4.0.2

3 months ago

4.0.1

3 months ago

4.0.0

3 months ago

3.0.7

3 months ago

3.0.6

3 months ago

3.0.4

3 months ago

3.0.5

3 months ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

4 months ago

2.0.5

4 months ago

2.0.0

4 months ago

1.0.0

4 months ago