-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upon Plugin Activation Save Default Settings #6
Comments
LMK if this issue is more appropriate in CMB2 core |
You should be able to use the register_activation_hook function (http://codex.wordpress.org/Function_Reference/register_activation_hook) to perform actions on the activation of your plugin. Run update_option here and save values under the meta keys you use for your fields and they will be available once the plugin is activated. |
I figured as much, the issue though is how to exactly do this... I'm guessing two foreach loops like so:
I'm having trouble getting to work though... |
This question is quite a bit out of scope for this project. Also, your example assumes we know what |
I agree it's a bit of a strange issue and I haven't provided too much context. Let me poke around a bit more on this... |
We are using CMB2 to create a tabbed plugin admin panel. When a new user installs and activates the plugin they have to manually save the options before they are stored in the database. Do you know of a quick way to save default values so they are immediately available post installation?
The text was updated successfully, but these errors were encountered: