I believe the issue is that your function that sets up the settings initially isn’t getting run upon activation. Add a call to your mouldings_register_settings_initial() in the activation hook, like this:
function mouldings_activate() {
global $wpdb, $mouldings_options;
mouldings_register_settings_initial();
if ($mouldings_options === false){
$mouldings_options = array(
'idea_item_columns' => '4'
);
update_option( 'mouldings_settings', $mouldings_options );
}
}
register_activation_hook( MOULDINGS_PLUGIN_FILE, 'mouldings_activate' );
Related Posts:
- WordPress register_activation_hook table creation not working
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How to Add an Index to Plugin Database table
- Creating two database tables via plugin
- How to find out if option exists but is empty?
- Function to activate WordPress theme inside a plugin
- Custom plugin settings: clicking “save changes” does not display success message
- How to fetch serialized data from wordpress options
- Activate Plugin which is in subfolder?
- Force plugin to fail activation
- The plugin generated x characters of unexpected output, $wpdb not defined
- Correct way to use register_activation_hook
- clean wp_options table unused rows
- Remove obsolete plugins artifacts from database tables
- add action wp_head not working
- Why is the Settings API is not saving my array of options
- Auto add content such as pages upon plugin activation?
- How to automate wordpress plugin activate and deactivate by php logic?
- Update Option Error: Notice: Undefined index
- Serialize data for wp options
- Building an email signup form. Where should the information be saved in the DB?
- How can I add an options page for my class based plugin?
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- Plugin Options Not Saving to Database in WP 4.5
- Get plugin option in another PHP file
- Own plugin corrups plugin-activation
- Is it possible to create Custom Post plug-in?
- Help With MySQL to WPDB Query Conversion
- How to get specific setting by settings_fields()?
- How to check if tables in WordPress still exists after activations
- Prevent duplicate records in plugin table
- Add Plugin options as subpage to Theme options page
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Force file download on plugin activation
- WordPress Backend HA (Automatic failover)
- How can I change the meta_key for a particular piece of information?
- wp_editor content in plugin options page
- Why this function not working for install database on plugin activation
- Redirect to another page using contact form 7? [closed]
- How to create multiple database tables on plugin activation?
- Can I create a table on my DB without creating a plugin?
- WordPress : Explain Plugins & Theme string value in database
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Run function on plugin activation before plugin is loaded
- How to insert and call new data in wordpress website database through a plugin
- Gathering and logging data from a plugin: how to do it without race conditions?
- WordPress error: Options page Setting_ not found in the allowed options list
- Issue running db create table query from static method
- Separate database for a wordpress plugin
- Can I use register_settings and unregister_setting once the settings page has loaded?
- update_option_{$option} not showing old value
- Updating options into the wp database performance
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Best/Correct way to add an option to a category
- What is the WordPress approach to custom data?
- get_option / wp_localize_script Not Working in OOP Plug In
- How to create plugin/ page that reads from database
- DB Query not working in Plugin
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- WordPress plugin: efficient way to store large data
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- Need to add/remove group of options and display them as rows
- My plugin does not install correctly if a previous version is still installed
- How to make sure settings are not lost when plugin is updated?
- How to make a Product page without ordering and database
- wp_options not returning value for logged out users?
- Activation flow of a plugin in a multisite environment
- How to save Setting pages data to the database?
- Problem with MEMCACHE and Redis with wp_options
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to securely controlling data without keeping it in postmeta?
- $wpdb->insert not working inside save_post tag
- How to check for already existing plugin versions on activation? and prevent errors
- My WordPress activation hook isn’t working
- Plugin Options Page and Subpage
- How to save the option’s new values plus old value without overwrite old one
- WP options plugin setting not saving the selected checkboxes
- Echo custom admin field into a is_single()
- Protect WordPress option value
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- How do I add a textarea (multirow) option to my WordPress plugin?
- Where do the section input fields values are stored in database
- database – multiple wordpress installations using same database – can they share plugin settings?
- how can i get records from wp_postmeta table using particular meta_key in database?
- How to create a new database table whenever user changes options
- Create Array from data in the OPTIONS table
- Is saving multiple options or saving multiple items in one option better?
- Saving an array to get_options
- How to find an option in the database?
- Building a simple “settings” plugin to change textstrings on the home page
- Create New Admin Menu Section – Like how custom post type works, in a way
- Creating fields in the database
- How to submit the custom form data in database in WordPress without plugin?
- get_option returning a different value from what’s saved
- How can I delete the options from DB when the plugin is deleted?
- register_activation_hook not working
- On the same site, how do I send data from a plugin file to a theme file?
- move setting data from wordpress api to codestar freamwork
- plugin doesn’t retrieve data from database