O3PO
in package
The core plugin class.
This is used to define internationalization, admin-specific hooks, and public-facing site hooks.
Also maintains the unique identifier of this plugin as well as the current version of the plugin.
Tags
Table of Contents
Properties
- $environment : O3PO_Environment
- The environment object from which information about the environment this plugin is running in can be obtained.
- $journal : O3PO_Journal
- The primary journal.
- $journal_secondary : O3PO_Journal
- The secondary journal.
- $loader : O3PO_Loader
- The loader that's responsible for maintaining and registering all hooks that power the plugin.
- $plugin_name : string
- The unique identifier of this plugin.
- $plugin_pretty_name : string
- The human readable name of this plugin.
- $primary_publication_type : O3PO_PrimaryPublicationType
- The primary publication type.
- $ready2publish_dashboard : O3PO_Ready2Publish_Dashboard
- The ready to publish dashboard.
- $ready2publish_form : O3PO_Ready2Publish_Form
- The ready to publish form.
- $ready2publish_storage : O3PO_Ready2Publish_Storage
- The ready to publish storage.
- $secondary_publication_type : O3PO_SecondaryPublicationType
- The secondary publication type.
- $version : string
- The current version of the plugin.
Methods
- __construct() : mixed
- Define the core functionality of the plugin.
- get_plugin_name() : string
- The name of the plugin used to uniquely identify it within the context of WordPress and to define internationalization functionality.
- get_plugin_pretty_name() : string
- The pretty name of the plugin
- get_version() : string
- Retrieve the version number of the plugin.
- journal_config_from_settings() : array<string|int, mixed>
- Generate a journal config from a settings object.
- run() : mixed
- Run the loader to execute all of the hooks with WordPress.
- setup_primary_journal() : O3PO_Journal
- Setup the primary journal.
- setup_secondary_journal() : O3PO_Journal
- Setup the secondary journal.
- define_admin_hooks() : mixed
- Register all of the hooks related to the admin area functionality of the plugin.
- define_public_hooks() : mixed
- Register all of the hooks related to the public-facing functionality of the plugin.
- load_dependencies() : mixed
- Load the required dependencies for this plugin.
- set_locale() : mixed
- Define the locale for this plugin for internationalization.
Properties
$environment
The environment object from which information about the environment this plugin is running in can be obtained.
protected
O3PO_Environment
$environment
Provides information about the environment the plugin is running in.
Tags
$journal
The primary journal.
protected
O3PO_Journal
$journal
The primary journal.
Tags
$journal_secondary
The secondary journal.
protected
O3PO_Journal
$journal_secondary
The secondary journal.
Tags
$loader
The loader that's responsible for maintaining and registering all hooks that power the plugin.
protected
O3PO_Loader
$loader
Maintains and registers all hooks for the plugin.
Tags
$plugin_name
The unique identifier of this plugin.
protected
string
$plugin_name
The string used to uniquely identify this plugin.
Tags
$plugin_pretty_name
The human readable name of this plugin.
protected
string
$plugin_pretty_name
The human readable name of this plugin.
Tags
$primary_publication_type
The primary publication type.
protected
O3PO_PrimaryPublicationType
$primary_publication_type
The primary publication type.
Tags
$ready2publish_dashboard
The ready to publish dashboard.
protected
O3PO_Ready2Publish_Dashboard
$ready2publish_dashboard
The ready to publish dashboard.
Tags
$ready2publish_form
The ready to publish form.
protected
O3PO_Ready2Publish_Form
$ready2publish_form
The ready to publish form.
Tags
$ready2publish_storage
The ready to publish storage.
protected
O3PO_Ready2Publish_Storage
$ready2publish_storage
The ready to publish storage.
Tags
$secondary_publication_type
The secondary publication type.
protected
O3PO_SecondaryPublicationType
$secondary_publication_type
The secondary publiction type.
Tags
$version
The current version of the plugin.
protected
string
$version
The current version of the plugin.
Tags
Methods
__construct()
Define the core functionality of the plugin.
public
__construct(string $plugin_name, string $plugin_pretty_name, string $version) : mixed
Set the plugin name and the plugin version that can be used throughout the plugin. Load the dependencies, define the locale, and set the hooks for the admin area and the public-facing side of the site.
Parameters
- $plugin_name : string
-
Simplified name of the plugin
- $plugin_pretty_name : string
-
Pretty name of the plugin
- $version : string
-
Version of the plugin
Tags
get_plugin_name()
The name of the plugin used to uniquely identify it within the context of WordPress and to define internationalization functionality.
public
get_plugin_name() : string
Tags
Return values
string —The name of the plugin.
get_plugin_pretty_name()
The pretty name of the plugin
public
get_plugin_pretty_name() : string
Tags
Return values
string —The pretty name of the plugin.
get_version()
Retrieve the version number of the plugin.
public
get_version() : string
Tags
Return values
string —The version number of the plugin.
journal_config_from_settings()
Generate a journal config from a settings object.
public
static journal_config_from_settings(O3PO_Settings $settings) : array<string|int, mixed>
Parameters
- $settings : O3PO_Settings
-
A settings object.
Tags
Return values
array<string|int, mixed> —Journal config.
run()
Run the loader to execute all of the hooks with WordPress.
public
run() : mixed
Tags
setup_primary_journal()
Setup the primary journal.
public
static setup_primary_journal(mixed $settings) : O3PO_Journal
Parameters
- $settings : mixed
-
O3PO_Settings Settings object from which to initialize the journal.
Tags
Return values
O3PO_Journal —Configured journal.
setup_secondary_journal()
Setup the secondary journal.
public
static setup_secondary_journal(mixed $settings) : O3PO_Journal
Parameters
- $settings : mixed
-
O3PO_Settings Settings object from which to initialize the journal.
Tags
Return values
O3PO_Journal —Configured journal.
define_admin_hooks()
Register all of the hooks related to the admin area functionality of the plugin.
private
define_admin_hooks() : mixed
Tags
define_public_hooks()
Register all of the hooks related to the public-facing functionality of the plugin.
private
define_public_hooks() : mixed
Tags
load_dependencies()
Load the required dependencies for this plugin.
private
load_dependencies() : mixed
Include the following files that make up the plugin:
- O3PO_Loader. Orchestrates the hooks of the plugin.
- O3PO_i18n. Defines internationalization functionality.
- O3PO_Admin. Defines all hooks for the admin area.
- O3PO_Public. Defines all hooks for the public side of the site.
- O3PO_Settings. Manages the settings of the plugin
- O3PO_Environment. Provides information about the environment this plugin is running in
Create an instance of the loader which will be used to register the hooks with WordPress.
Tags
set_locale()
Define the locale for this plugin for internationalization.
private
set_locale() : mixed
Uses the O3PO_i18n class in order to set the domain and to register the hook with WordPress.