Options - dotherightthing/wpdtrt-plugin-boilerplate GitHub Wiki

Summary

DTRT WordPress Plugin Boilerplate uses a configuration array, separated into several different option types.

Status

  • Stable @ 1.3.2
  • Option merging may be problematic with old data is used, use unset() to remove unwanted persistent array keys
  • Needs further documentation

Option types

Various options are stored in a single, multidimensional $options array, which is saved to the WordPress Options table.

Plugin options

$options['plugin_options']

  • What: Global options available anywhere in the Plugin
  • Format: An array of options, each describing a form input for data collection and display
  • Defaults: Set in wpdrt-pluginname.php
  • Updates: Updated via user input on plugin options page
  • See: Options: Add a global option

Plugin dependencies

$options['plugin_dependencies']

Instance Options

$options['instance_options']

Plugin data

$options['plugin_data']

Plugin data options

$options['plugin_data_options']

  • What: meta data attached to the plugin data, to determine refresh frequency
  • Format: An array containing two options: last_updated and force_refresh
  • Defaults: -
  • Updates: TODO - Via options page?
  • See: -