About
This package is for retrieving posts/categories/tags directly from wordpress database.
Written in TypeScript and type declarations are provided.
Usage
Installation
$ npm i wpdb-js mysql2
Initialization
knex.js is used internally. knex-style config should be passed at initialization.
const db = client: "mysql2" connection: host: "..." user: "..." password: "..." database: "..." ;
Methods
listCategories
db ;
listTags
db ;
listPosts
db ;
// sort posts (ascending order)dbdbdb// sort posts (descending order)db// filter by statusdbdb// filter by category iddb// filter by tag iddb// set limit/offsetdbdb
findCategory
db ;
findTag
db ;
findPost
db ;