Activator
in package
FinalYes
Fired by the plugin activation process.
- This class contains the functionality to run during the plugin's activation.
Tags
Table of Contents
Constants
- ACTIVATION_KEY = 'psite_activated'
- The plugin activation key in wp_options.
- DB_VERSION_KEY = 'pnet_db_version'
- The database version key in wp_options.
Methods
- run() : void
- Run the plugin activation process.
- add_author_capabilities() : void
- Set extra role capabilities for authors.
- reset_permalinks() : void
- Reset permalinks.
- set_db_version() : void
- Set databse version.
Constants
ACTIVATION_KEY
The plugin activation key in wp_options.
private
string
ACTIVATION_KEY
= 'psite_activated'
Tags
DB_VERSION_KEY
The database version key in wp_options.
private
string
DB_VERSION_KEY
= 'pnet_db_version'
Tags
Methods
run()
Run the plugin activation process.
public
static run() : void
- User capability and nonce check is done in core.
Tags
add_author_capabilities()
Set extra role capabilities for authors.
private
static add_author_capabilities() : void
- Authors need to read private pages and posts to access the members area.
- Authors need to edit their own pages and published pages to manage their content.
Tags
reset_permalinks()
Reset permalinks.
private
static reset_permalinks() : void
- Must be last action in activation.
- Initialise any CPT or custom taxonomies that will affect permalinks.
- Post series taxonomy.
- Flush permalink rewrite rules.
Tags
set_db_version()
Set databse version.
private
static set_db_version() : void