Activate and/or init plugin
-
I’ve working on a relatively complex plugin but an not at all clear on which bits of it should be in activiate & which in init. As of now virtually all of it is in
add_action('init', 'rmaInit'). In outline, rmaInit does the following:- Use a Plugin class for creating the plugin
- Define 10 plugin settings
- Use a SettingsPage class to create the settings page
- Define 4 page titles, contents, creation class & function
- Define 2 templates
- Use a PageTemplater class to create templates
- Call a class to create a table, contingent on a plugin setting
Yet to be added is a daily WP_Cron job to update the table created above if it’s created.
When I called the
rmaInitfunction with the activation hook, the plugin was shown as created but its settings were not available. So I’m led to ask what of any of the current functions done by thermaInitfunction should be in an activation hook, or …?Code available on request, but the
rmaInitis currently ~100 lines.PS: is this a support question or not? I’m not clear on what is implied by the checkbox re: support questions.
The topic ‘Activate and/or init plugin’ is closed to new replies.