- create custom form with all kind of input
- save data to custom entity(CPT in WP)
- make REST API for this entity
- handle user account permissions
- created
custom-form.phptemplate - added
hooksto handle form submit - added
Custom Post Type newsinfunctions.php - enabled user registration
- installed JWT Authentication for WP REST API to handle authenticated requests
- created
REST API Plugin for newsto make custom routes and endpoints for CPTnews/v1/published- GET : get all news
- POST : suggest news
news/v1/user- POST:register new user
jwt-auth/v1/news/v1/published/{ID}- GET : get news with
{ID} - POST : replace news with
{ID} - DELETE : delete news with
{ID}
- GET : get news with
- created React News app based on this REST API
- handle request,sql errors
- scale REST API with PUT,OPTION methods
- add custom fields to quick edit mode
- clone project to your server enviroment
- import
wp-db-dump.sqlto wordpress DB though mysql cli or phpmyadmin and make necessary changes inwp-config.php - browse to http://localhost/WP-Blog/
| Login | Password |
|---|---|
| admin | admin |
if you run into error 404 when browsing the site try:
- switching from
post nametoplainand back topost nameat http://localhost/WP-Blog/wp-admin/options-permalink.php to update permalink structure - make sure your
httpd.confhas lineLoadModule rewrite_module modules/mod_rewrite.soandAllowOverride Allunder your http root dir(<Directory "/srv/http">)