pSite
Table of Contents
Classes
- Media
- Adds administration functions to media uploads.
- Tax_Meta
- Taxonomy extended meta data functionality.
- Users
- Extended user information.
- Email_Welcome_User
- Handle new user welcome email.
- Post_Series
- Define post series taxonomy.
- Activator
- Fired by the plugin activation process.
- Deactivator
- Fired by the plugin deactivation process.
- Loader
- Register all actions and filters for the plugin.
- pSite
- The core plugin class.
- Updater
- Plugin updater.
- Assets
- Enqueue the stylesheet and JavaScript to support plugin specific functionality.
- Form_User_Account
- User account edit profile form functionality.
- Member
- Provides member information and functionality.
- Post_Series
- Displays list of post summaries in the series on relevant posts.
- RSS
- Site RSS functionality.
- Account_Edit_Form
- User account profile form shortcode.
- Member_Grid
- Shortcode to provide a grid of member cards.
- Member_List
- Member home page links list shortcode.
- Series_Summary
- Post series summary shortcode.
Constants
- OPTION_NAME = 'pnet_db_version'
- DB version option name.
- REQUIRED_USER = 'devmaster'
- Required user name.
- REQUIRED_VERSION = '6.8.0'
- Required db version.
Functions
- autoloader() : void
- Dynamically load the referenced class.
- get_plugin_metadata() : string
- Return a metadata value.
- get_asset_version() : string
- Return the asset version.
- get_asset_path() : string
- Return the fully qualified path to an asset.
- get_asset_url() : string
- Return the asset URL.
- run_plugin() : void
- Plugin execution.
- delete_user_meta() : void
- Delete user metadata added by this plugin.
- delete_terms() : void
- Delete taxonomy terms added by this plugin.
- delete_options() : void
- Delete wp_options entries.
- is_production() : bool
- Check if this is a production site.
- is_upgrade_required() : bool
- Check if upgrade is required.
- is_correct_user() : bool
- Check if the correct user is running this script.
- upgrade_database() : void
- Upgrade the database.
- do_upgrades() : bool
- Perform the upgrades.
- set_word_count_metadata() : bool
- Set word count metadata for all posts.
- delete_jetpack_artefacts() : bool
- Remove Jetpack artefacts.
Constants
OPTION_NAME
DB version option name.
public
string
OPTION_NAME
= 'pnet_db_version'
Tags
REQUIRED_USER
Required user name.
public
string
REQUIRED_USER
= 'devmaster'
- If this is set, the upgrader will only run if the current user matches this name.
- Only set this if the upgrader calls functions that have user capability checks.
Tags
REQUIRED_VERSION
Required db version.
public
string
REQUIRED_VERSION
= '6.8.0'
- This MUST be set to the plugin version if upgrader is to run. Leave as a value less than the current version to skip upgrade.
Tags
Functions
autoloader()
Dynamically load the referenced class.
autoloader(string $required_class) : void
This is the recommended WordPress approach, so if/else is OK.
Parameters
- $required_class : string
-
The fully-qualified name of the class to load.
Tags
get_plugin_metadata()
Return a metadata value.
get_plugin_metadata(string $field) : string
Parameters
- $field : string
-
The field to search for.
Tags
Return values
string —The metadata value.
get_asset_version()
Return the asset version.
get_asset_version(string $asset) : string
Production uses plugin version. Non-production uses resource file mtime. Use for scripts and styles.
Parameters
- $asset : string
-
The file path of the target asset.
Tags
Return values
string —The asset version.
get_asset_path()
Return the fully qualified path to an asset.
get_asset_path([string $asset = '' ]) : string
An empty string returns the assets folder path.
Parameters
- $asset : string = ''
-
The partial path of the target asset. A leading slash is required.
Tags
Return values
string —The asset path.
get_asset_url()
Return the asset URL.
get_asset_url([string $asset = '' ]) : string
An empty string returns the assets folder URL.
Parameters
- $asset : string = ''
-
The partial path of the target asset. A leading slash is required.
Tags
Return values
string —The asset URL.
run_plugin()
Plugin execution.
run_plugin() : void
Tags
delete_user_meta()
Delete user metadata added by this plugin.
delete_user_meta() : void
Tags
delete_terms()
Delete taxonomy terms added by this plugin.
delete_terms() : void
- SQL manipulation of the tables is used because the taxonomies are not registered when uninstall is called.
- Most WordPress core taxonomy functions will NOT work.
Tags
delete_options()
Delete wp_options entries.
delete_options() : void
Tags
is_production()
Check if this is a production site.
is_production() : bool
Tags
Return values
bool —True if this is a production site, false otherwise.
is_upgrade_required()
Check if upgrade is required.
is_upgrade_required() : bool
Tags
Return values
bool —True If stored version is less than the required version, false otherwise.
is_correct_user()
Check if the correct user is running this script.
is_correct_user() : bool
- If REQUIRED_USER is set, the upgrader will only run if the current user matches this name.
Tags
Return values
bool —True if the current user matches the required user, false otherwise.
upgrade_database()
Upgrade the database.
upgrade_database() : void
- Abort if this is a production site.
- Abort if upgrade is not needed.
- If REQUIRED_USER is set, the upgrader will only run if the current user matches this name.
- Delete this file after successful upgrade.
Tags
do_upgrades()
Perform the upgrades.
do_upgrades() : bool
- Call functions from here to perform the actual database upgrades.
- Bail if any function fails.
Tags
Return values
bool —True if upgrade was successful, false otherwise.
set_word_count_metadata()
Set word count metadata for all posts.
set_word_count_metadata() : bool
Tags
Return values
bool —True if successful, false otherwise.
delete_jetpack_artefacts()
Remove Jetpack artefacts.
delete_jetpack_artefacts() : bool
- Remove Jetpack comment metadata.
- Remove Jetpack post metadata.
Tags
Return values
bool —True if successful, false otherwise.