I would store the array to the options able as a serialized value.
update_option('dw_quotes', serialize($quotes));
and retrieve with:
$quotes = get_option('dw_quotes', null);
if ($quotes !== null) { $quotes = unserialize($quotes); }
Other things to consider:
Add handling in case the quotes option does not exist.
Also add handling to delete quotes from the option table when the plugin is deleted. See:
http://codex.wordpress.org/Function_Reference/register_uninstall_hook
Related Posts:
- How to Loop Plugin Option Field Set?
- Customizing subject in comment notification e-mails
- How to handel multiple checkbox field in the admin settings page with Settings API
- HELP: Integrating WP with raw PHP code once published button is hit
- I would like to use create a function in my custom plugin to tell WP to use a different header
- Scope for PHP Variables Assigned in functions.php or a plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- wordpress plugin is not activating from widget
- Edit Yoast SEO breadcrumbs output [closed]
- Conditional attributes and logic per product category
- WordPress get_avatar function not correct working
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- execute function after one completed
- Plugin onclick button activate other plugin
- Different registration form for different roles
- More gentle way to hook WordPress custom url
- How to add custom function to pluggable.php
- Checkbox show / hide output result
- Allow a particular user to access a particular plugin?
- Cookie value changes back to previous value after changing
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- working code, not working – Plugin Dev
- Is admin section completely customizable in terms of styling?
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- Populate select option with JSON file
- Saving an array to get_options
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- How use Dynamic hyperlink on each wordpress post?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Where can I find a schema of wordpress plugin core architecture?
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- Plugin update error message
- category_name not working (not showing up in sql query debug)
- How can I make my custom shortcode work in a Custom HTML Widget?
- Update Multiple Post Meta for the Same Post In One call?
- Custom plugin settings: clicking “save changes” does not display success message
- Rename existing old uploaded images containing accented French characters (not during upload)
- How to Create a Directory in a Plugin Folder?
- Create plugin that works in background
- Checking for user role in a custom plugin
- Extend Elementor Archive Posts widget with a custom skin in order to show multiple badges
- Loading class files via autoload method
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- Getting media library popup in custom plugin admin page
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- Escape when echoed
- How to get variables from fucntion.php to my plugin files
- Redirecting to home page after login as custom role WordPress
- How to stop or remove an action being called inside a function of an extended class
- Date calculations from 2 custom fields
- How to enable specific plugin only based around shop manager role?
- Adding a new field to the address field type in gravity forms
- Show admin notice on incorrect value on form field
- Nested shortcode functions accessing variable
- List the authors that have written posts in a category
- Activate my plugins via FTP
- How to add apply_filter for a class property in plugin
- Checking the count within a foreach loop
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- Need to replace Currency Shortforms
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- Using meta_query in a WP_Query not working for numbers properly
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- How to copy the all WordPress media items to another custom plugin folder?
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- implement checkbox or toggle switch in plugin code
- Create a form and have custom menu display based on user answers?
- Problem with conditional woocommerce custom checkout field
- How can I insert a record into a custom table from my custom form in my custom admin page?
- how to create table during plugin installation in side a class
- Posting code inside the post instead of in the template file using shortcode
- Metabox Data not saving
- Including a PHP file via a function that is part of a plugin?
- Pass strings to plugin function [closed]
- How to fix ‘Call to undefined function do_settings()’ error?
- How to tweak a plugin without preventing it from updating
- how to search through plugin in wordpress cimy-user-extra-fields?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- wp_handle_upload – specified file failed upload test
- How to change all the urls of the WordPress site?
- How to make a Template page to show the information of different things Shop and Product page?
- public custom posts not showing in my wordpress plugin
- I want to allow certain file types on dokan upload files