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?
- Mixed results with is_page() WordPress function, when using $this, or self
- Read page- or post-content across different builder-plugins
- How to create a custom post type that contains another custom post type?
- WP Query. Is there a maximum size?
- Perform internal redirect in WordPress?
- How to prevent plugins from loading jQuery
- Which file of wordpress manage plugins functionalities?
- Difference and examples of esc_attr__() and esc_attr_e()
- Change the display of Settings API (do_settings_sections)
- What is @Action in WordPress?
- Setup wp_schedule_event within a custom plugin
- Create a plugin from within WordPress
- Class variables not correct on page
- List the authors that have written posts in a category
- Load Javascript from Plugin in One Page Only?
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- Activate my plugins via FTP
- Settings API saved values not getting shown in the dropdownbox
- Duplicate results are displayed in a custom plugin [closed]
- Why is my custom post type not being activated on plug-in activation?
- How to add apply_filter for a class property in plugin
- Issue running db create table query from static method
- Checking the count within a foreach loop
- Can I use register_settings and unregister_setting once the settings page has loaded?
- How to make multiple admin pages for one plugin?
- WordPress checkbox and Illegal string offset
- Include a php file from another plugin
- plugins_url() works everywhere but wp_reqister_script()
- JQuery prepend a function
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- Integrating boxtal PHP library into a custom WordPress Plugin
- How to redirect to same page after form submission
- how to save checkbox data for custom setting?
- 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
- wp_dequeue_script for a Plugin
- Need to replace Currency Shortforms
- wp_enqueue_scripts
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- How do I add $_SESSION[”] to my wordpress page?
- How to get specific string/value from an array? php [closed]
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Shortcode Attributes to Return different $_POST
- How to make a dynamic css class whose name changes every visit to confuse scraper
- I receive taxonomy id
- WordPress Stock Update Programatically
- output html on post or page from custom plugin [closed]
- Loop in elementor custom widget not working
- How to create plugin/ page that reads from database
- How can I fetch data from another website to my wordpress website with mysql database
- Save user total active time after login in wordpress [closed]
- Send email with list of active plugins upon activation/deactivation
- Built a second plugin but it overwrote the first one
- Creating a functionality plugin to edit seriously simple podcasting
- How WordPress core manage the plugin installation
- Using custom fields for image alt and title
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Switch from wp-cron to a server cron job
- How to translate wordpress error message