\O3PO

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.

Summary

Methods
Properties
Constants
__construct()
run()
get_plugin_name()
get_plugin_pretty_name()
get_version()
journal_config_from_settings()
setup_primary_journal()
setup_secondary_journal()
No public properties found
No constants found
No protected methods found
$plugin_name
$plugin_pretty_name
$version
$loader
$environment
$journal
$journal_secondary
$ready2publish_storage
$ready2publish_form
$ready2publish_dashboard
$primary_publication_type
$secondary_publication_type
N/A
load_dependencies()
set_locale()
define_admin_hooks()
define_public_hooks()
No private properties found
N/A

Properties

$plugin_name

$plugin_name : string

The unique identifier of this plugin.

Type

string — The string used to uniquely identify this plugin.

$plugin_pretty_name

$plugin_pretty_name : string

The human readable name of this plugin.

Type

string — The human readable name of this plugin.

$version

$version : string

The current version of the plugin.

Type

string — The current version of the plugin.

$loader

$loader : \O3PO_Loader

The loader that's responsible for maintaining and registering all hooks that power the plugin.

Type

\O3PO_Loader — Maintains and registers all hooks for the plugin.

$environment

$environment : \O3PO_Environment

The environment object from which information about the environment this plugin is running in can be obtained.

Type

\O3PO_Environment — Provides information about the environment the plugin is running in.

$journal

$journal : \O3PO_Journal

The primary journal.

Type

\O3PO_Journal — The primary journal.

$journal_secondary

$journal_secondary : \O3PO_Journal

The secondary journal.

Type

\O3PO_Journal — The secondary journal.

$ready2publish_storage

$ready2publish_storage : \O3PO_Ready2Publish_Storage

The ready to publish storage.

Type

\O3PO_Ready2Publish_Storage — The ready to publish storage.

$ready2publish_form

$ready2publish_form : \O3PO_Ready2Publish_Form

The ready to publish form.

Type

\O3PO_Ready2Publish_Form — The ready to publish form.

$ready2publish_dashboard

$ready2publish_dashboard : \O3PO_Ready2Publish_Dashboard

The ready to publish dashboard.

Type

\O3PO_Ready2Publish_Dashboard — The ready to publish dashboard.

$primary_publication_type

$primary_publication_type : \O3PO_PrimaryPublicationType

The primary publication type.

Type

\O3PO_PrimaryPublicationType — The primary publication type.

$secondary_publication_type

$secondary_publication_type : \O3PO_SecondaryPublicationType

The secondary publication type.

Type

\O3PO_SecondaryPublicationType — The secondary publiction type.

Methods

__construct()

__construct(string  $plugin_name, string  $plugin_pretty_name, string  $version) 

Define the core functionality of the plugin.

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

string $plugin_name

Simplified name of the plugin

string $plugin_pretty_name

Pretty name of the plugin

string $version

Version of the plugin

run()

run() 

Run the loader to execute all of the hooks with WordPress.

get_plugin_name()

get_plugin_name() : string

The name of the plugin used to uniquely identify it within the context of WordPress and to define internationalization functionality.

Returns

string —

The name of the plugin.

get_plugin_pretty_name()

get_plugin_pretty_name() : string

The pretty name of the plugin

Returns

string —

The pretty name of the plugin.

get_version()

get_version() : string

Retrieve the version number of the plugin.

Returns

string —

The version number of the plugin.

journal_config_from_settings()

journal_config_from_settings(\O3PO_Settings  $settings) : array

Generate a journal config from a settings object.

Parameters

\O3PO_Settings $settings

A settings object.

Returns

array —

Journal config.

setup_primary_journal()

setup_primary_journal(  $settings) : \O3PO_Journal

Setup the primary journal.

Parameters

$settings

O3PO_Settings Settings object from which to initialize the journal.

Returns

\O3PO_Journal

Configured journal.

setup_secondary_journal()

setup_secondary_journal(  $settings) : \O3PO_Journal

Setup the secondary journal.

Parameters

$settings

O3PO_Settings Settings object from which to initialize the journal.

Returns

\O3PO_Journal

Configured journal.

load_dependencies()

load_dependencies() 

Load the required dependencies for this plugin.

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.

set_locale()

set_locale() 

Define the locale for this plugin for internationalization.

Uses the O3PO_i18n class in order to set the domain and to register the hook with WordPress.

define_admin_hooks()

define_admin_hooks() 

Register all of the hooks related to the admin area functionality of the plugin.

define_public_hooks()

define_public_hooks() 

Register all of the hooks related to the public-facing functionality of the plugin.