PHP Class TEXTDOMAIN_Theme_Plugin_Enhancements, theme-tools

Show file Open project: Automattic/theme-tools

Public Properties

Property Type Description
$display_notice
$plugins

Public Methods

Method Description
__construct ( ) Determine the plugin enhancements declared by the theme.
admin_notices ( ) Display the admin notice for the plugin enhancements.
get_module_name ( string $module ) Set the name of our modules. This is just so we can easily refer to them in a nice, consistent, human-readable way.
get_theme_dependencies ( ) Let's see which modules (if any!) this theme relies on.
init ( ) Init function.
plugin_activate_url ( string $slug ) Helper function to return the URL for activating a plugin.
plugin_install_url ( string $slug ) Helper function to return the URL for installing a plugin.
set_module_status ( ) For Jetpack modules, we want to check and see if those modules are actually activated.
set_plugin_status ( ) Determine the status of each of the plugins declared as a dependency by the theme and whether an admin notice is necessary or not.

Method Details

__construct() public method

Themes must declare the plugins on which they depend by using add_theme_support( 'plugin-enhancements' ). If there are plugin enhancements and any of the enhancements are either not installed or not activated, alert the user.
public __construct ( )

admin_notices() public method

Display the admin notice for the plugin enhancements.
public admin_notices ( )

get_module_name() public method

Set the name of our modules. This is just so we can easily refer to them in a nice, consistent, human-readable way.
public get_module_name ( string $module )
$module string The slug of the Jetpack module in question.

get_theme_dependencies() public method

Let's see which modules (if any!) this theme relies on.

init() static public method

Init function.
static public init ( )

plugin_activate_url() public method

Helper function to return the URL for activating a plugin.
public plugin_activate_url ( string $slug )
$slug string Plugin slug; determines which plugin to activate.

plugin_install_url() public method

Helper function to return the URL for installing a plugin.
public plugin_install_url ( string $slug )
$slug string Plugin slug; determines which plugin to install.

set_module_status() public method

For Jetpack modules, we want to check and see if those modules are actually activated.
public set_module_status ( )

set_plugin_status() public method

Determine the status of each of the plugins declared as a dependency by the theme and whether an admin notice is necessary or not.
public set_plugin_status ( )

Property Details

$display_notice public property

public $display_notice

$plugins public property

public $plugins