pfeifferNet

pfic

Table of Contents

Classes

Add_Ratings
Bulk add ratings to recipes.
Assets
Register and enqueue the admin-specific stylesheets and JavaScript.
Chapter_Meta
Chapter taxonomy meta data admin functionality.
Ingredients
Class to provide ingredients custom post type admin functionality.
Media
Add administration functions to media uploads.
Oldest_Updated
List the least recently updated recipes.
Tax_Meta
Taxonomy extended meta data functionality.
Chapters
Define pfic site chapters taxonomy.
Email_New_Content
Send recent posts update email.
Email_Welcome_User
Handle new user welcome email.
Ingredients
Class to define ingredients custom post type definition.
Users
Site users functionality.
Activator
Fired by the plugin activation process.
Deactivator
Fired by the plugin deactivation process.
Loader
Register all actions and filters for the plugin.
pfic
The core plugin class.
Updater
Plugin updater.
Assets
Enqueue the stylesheet and JavaScript to support plugin specific functionality.
Chapter
Define cookbook chapters functionality.
Collection
Provides post or recipe collection ids.
Featured_Recipes
Provides post or recipe ids for our favourite recipes.
Form_Print_Selector
Print content selection form.
Form_User_Account
User account edit profile form functionality.
Highest_Rated
Provides highest rated recipe posts information.
Ingredient
Public-facing ingredients functionality.
Menu_Action_Links
Provide buttons for menu post actions.
Most_Viewed
Provides most viewed post or recipe ids.
Posts
Post-related helper functionality.
Recipe
Provides recipe information.
RSS
RSS functionality.
User_Favourites
Provides post or recipe ids for favourite recipes by user.
Print_Chapter_Intro
Print the introduction to a cookbook chapter.
Print_Chapter
Print a cookbook chapter.
Print_Editor_Content
Print content for the editor.
Print_Essays
Print essays collection.
Print_Footer
Print page footer.
Print_General
Print general chapter collection.
Print_Howto_Posts
Print howto posts collection.
Print_Ingredients
Print ingredients collection.
Print_Menus
Print menu collection.
Print_Posts
Print posts collection.
Print_Recipe_Posts
Print recipe posts collection.
Print_Recipes
Print recipes collection.
Print_Toc
Print table of contents.
Printing
Print collection items.
Account_Edit_Form
Display the user account profile form.
Chapter_Grid
Display a grid of chapter taxonomy entities as cards.
Favourite_Buttons
Display buttons to add or remove a user's recipe favourite
Ingredient_Links
Display buttons to access further info on ingredient.
Menu_Action_Links
Display a set of buttons for menu post actions.
Print_Footer
Print the footer content for the print page.
Print_Selector
Display the print content selection parameters.
Recipe_URL
Displays the recipe url.

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.
get_print_url()  : string
Return the print page URL.
run_plugin()  : void
Plugin execution.
delete_post_meta()  : void
Delete post metadata added by this plugin.
delete_terms()  : void
Delete taxonomy terms added by this plugin.
delete_cpt_content()  : void
Delete the CPT content 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
since
6.0.0

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
since
6.8.0

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
since
6.0.0

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
SuppressWarnings

(PHPMD.ElseExpression)

since
5.4.0
uses
get_plugin_metadata()

get_plugin_metadata()

Return a metadata value.

get_plugin_metadata(string $field) : string
Parameters
$field : string

The field to search for.

Tags
since
6.3.0
used-by
autoloader()
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 last modified time.
  • Use for scripts and styles.
Parameters
$asset : string

The fully qualified file path of the target asset.

Tags
since
5.10.0
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
since
6.3.0
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
since
6.3.0
Return values
string

The asset URL.

get_print_url()

Return the print page URL.

get_print_url() : string
Tags
since
5.11.0
Return values
string

The print page URL.

run_plugin()

Plugin execution.

run_plugin() : void
Tags
since
1.0.0

delete_post_meta()

Delete post metadata added by this plugin.

delete_post_meta() : void
Tags
since
6.1.0

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
since
6.1.0

delete_cpt_content()

Delete the CPT content added by this plugin.

delete_cpt_content() : void
Tags
todo

#75 Determine CPT content deletion strategy on uninstall.

since
6.1.0

delete_options()

Delete wp_options entries.

delete_options() : void
Tags
since
6.1.0

is_production()

Check if this is a production site.

is_production() : bool
Tags
since
6.2.0
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
since
6.0.0
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
since
6.8.0
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
since
6.0.0
since
6.2.0

Abort if this is a production site.

since
6.8.0

Check if the correct user is running this script.

since
6.8.0

Delete the script after successful upgrade.

do_upgrades()

Perform the upgrades.

do_upgrades() : bool
  • Call functions from here to perform the actual database upgrades.
  • Bail if any function fails.
Tags
since
6.0.0
since
6.2.0

Update chapter term slugs to remove sequence prefix.

since
6.3.0

Add GitHub API token date.

since
6.5.0

Update chapter taxonomy meta data to include has-recipes setting.

since
6.6.0

Update the autoincrement value for the user table.

since
6.7.0

Add related posts to post meta table and define the number of them to display.

since
6.7.0

Add cron jobs to update selected content and transients.

since
6.8.0

Add word count metadata bulk update.

since
6.8.0

Remove Jetpack artefacts.

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
since
6.8.0
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
since
6.8.0
Return values
bool

True if successful, false otherwise.


        
On this page

Search results