Stars: 155
Forks: 18
Pull Requests: 51
Issues: 11
Watchers: 11
Last Updated: 2023-07-18 21:52:58
❤️ A WordPress plugin that adds features to use WordPress as a headless CMS with any front-end environment using REST API
License:
Languages: JavaScript, CSS, PHP, SCSS
A WordPress plugin that adds features to use WordPress as a headless CMS with any front-end environment using REST API. This plugin provides multiple features and you can use the one's that are relevant to your front-end application. You don't necessarily need to use all.
composer require imranhsayed/headless-cmsDownload and activate plugin from WordPress.org
| Name | Github Username |
|---|---|
| Imran Sayed | @imranhsayed |
Assets folder contains webpack setup and can be used for creating blocks or adding any other custom scripts like javascript for admin.
npm i from assets folder to install required npm packages.npm run dev during development for assets.npm run prod for production.npm run eslint:fix js/fileName.js for fixing and linting eslint errors and warning.This plugin provides you different endpoints using WordPress REST API.
These instructions will get you a copy of the project up and running on your local machine for development purposes.
You need to have any WordPress theme activated on your WordPress project, which has REST API enabled.
/wp-content/plugins/ directory, or install a zipped directory of this plugin through the WordPress plugins screen directly.Example of front-end applications where this plugin can be used:
Settings for getting data for a custom page like Hero section, Search section, Featured post section, latest posts heading.
Registers custom end points
{
wooCountries {
billingCountries {
countryCode
countryName
}
shippingCountries {
countryCode
countryName
}
}
wooStates(countryCode: "in") {
states {
stateCode
stateName
}
}
}{
shippingInfo {
shippingZones
storePostCode
}
}mutation ADD_ITEM {
addToWishlist(input: {clientMutationId: "example", productId: 340}) {
clientMutationId
error
added
productId
wishlistProductIds
}
}mutation REMOVE_ITEM{
removeFromWishlist(input: {clientMutationId: "example", productId: 340}) {
error
productId
removed
wishlistProductIds
}
}query GET_WISHLIST {
getWishList {
productIds
error
products {
databaseId
name
slug
buttonText
image {
alt
src
attachmentId
}
priceHtml
productUrl
stockQuantity
stockStatus
typename
}
}
} posts {
nodes {
seo {
schemaDetails
}
}
}http://example.com/wp-json/rae/v1/post?post_id=1http://example.com/wp-json/rae/v1/posts?page_no=1http://example.com/wp-json/rae/v1/header-footer?header_location_id=hcms-menu-header&footer_location_id=hcms-menu-footer/wp-json/rae/v1/wc/countries//wp-json/rae/v1/wc/states?countryCode=INPlease read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
I use Git for versioning.