Skip to content
David Ryan edited this page Jan 29, 2018 · 2 revisions

The Options Builder Class is a wrapper for Data APIs in WordPress.

Vocabulary/Terms Used:

  • Panel/Page - These are WordPress Admin Pages. They contain sections.
  • Sections - These are tabs on the admin pages navigated by hash and containing some sub-properties.
  • Parts - These are pieces within sections, often a data field, but sometimes a simple markdown file.

Getting Started

  1. Check sure the WPOP\\LATEST_V_NAMESPACE\\Panel class and instantiate/queue composer autoloader if needed
  2. Declare use WPOP\LATEST_V_NS as Opts; at the top of your file to ease namespace access
  3. Create your sections + parts to display on your panel (see examples).
  4. Create a new Opts\Page::initialize_panel() with your config array() and sections/parts array().
  5. Run the initialize_panel() method

Frequently Asked Questions

How do I adjust the user permissions?

By default manage_options is used. Please adjust accordingly. Per-option permissions aren't baked-in, but could be accomplished by filtering array by current_user_can().

I'm getting a fatal error, what gives?

Declaring the wrong namespace version string will definitely fatal error. This is common in development.