pfeifferNet

Activator
in package

FinalYes

Fired by the plugin activation process.

  • This class contains the functionality to run during the plugin's activation.
Tags
since
1.0.0
since
5.11.0

Refactor to simplify and remove multisite network activation.

since
6.1.0

Simplify and use smaller, modular functions.

Table of Contents

Constants

ACTIVATION_KEY  = 'pnet_activated'
The plugin activation key in wp_options.
SETTINGS_KEY  = 'pnet_settings'
The plugin settings key in wp_options.

Methods

run()  : void
Run the plugin activation process.
add_attachments_folder()  : void
Add email attachments folder if needed.
add_pages()  : void
Add required pages if needed.
reset_permalinks()  : void
Reset permalinks.
set_cron_jobs()  : void
Set cron tasks.
set_settings()  : void
Set empty plugin settings option, if needed.

Constants

ACTIVATION_KEY

The plugin activation key in wp_options.

private string ACTIVATION_KEY = 'pnet_activated'
Tags
since
6.1.0

SETTINGS_KEY

The plugin settings key in wp_options.

private string SETTINGS_KEY = 'pnet_settings'
Tags
since
6.1.0

Methods

add_attachments_folder()

Add email attachments folder if needed.

private static add_attachments_folder() : void
Tags
since
6.1.0

add_pages()

Add required pages if needed.

private static add_pages() : void
  • Don't overwrite existing pages.
Tags
since
6.1.0

Reset permalinks.

private static reset_permalinks() : void
  • Must be last action in activation.
  • Flush permalink rewrite rules.
Tags
since
6.1.0

set_cron_jobs()

Set cron tasks.

private static set_cron_jobs() : void
  • Note that the start time and date is in UTC.
  • This will override any existing cron settings for that job.
Tags
since
6.7.0

set_settings()

Set empty plugin settings option, if needed.

private static set_settings() : void
  • Use add_option() to prevent overwriting any existing settings.
Tags
since
6.1.0

        
On this page

Search results