WebDevStudios / wds-headless-wordpress

This codebase has been moved to a monorepo. Please see the documentation to learn more. 🍻
https://github.com/WebDevStudios/nextjs-wordpress-starter
GNU General Public License v2.0
32 stars 15 forks source link

Feature: Options Page, Part 1 #14

Closed tommcfarlin closed 3 years ago

tommcfarlin commented 3 years ago

There is currently no Jira ticket associated with this PR.

Link

This is not available on lab.

Feature Description

This introduces an option page that can be driven by either wp-config.php or by user input. If values are defined in wp-config.php then those values are used to populate the options; otherwise, the user can populate the options.

Feature Screenshots

You can access this new page by clicking on:

  1. Settings
  2. Theme Settings

Notes

This will eventually replace the ACF Options that we have, but this menu option is not yet in a place to do that. I still need to introduce:

  1. Administration area styles
  2. GraphQL support as outlined in #10

Steps To Verify Feature

How will your Lead Engineer and/or stakeholder test this?

Using Constants

Assume that you've populated the wp-config.php file with something like the following:

define('HEADLESS_FRONTEND_URL', 'https://nextjs.test');
define('WORDPRESS_PREVIEW_SECRET', '768438956748948');
define('GRAPHQL_JWT_AUTH_SECRET_KEY', '-+-07875493758');

Then you should see something like this:

image

You will only be able to save the options for the 404 page.

Without Using Constants

If you remove at least one constant (it's all or nothing) then you see the following and you can test by populating the fields.

image

Feature Documentation

Please link to the client facing website documentation you created in [Confluence]().

Other