Articles of add options

meta fields for the whole wordpress site

Is there a simple way to store additional information related to the whole website in a meta field? For users, comments or posts, I learned how to use meta fields to store their additional related information, but sometimes I need to have growing arrays that contain additional information about the whole website. Your clarifications are […]

Passing array in add_option()

I have to create a option page in my custom theme wordpress. here is is a sample of code <?php function bguru_register_settings(){ $default_options=array( ‘bguru_logo’=>’http://img.mywordpresstips.com/php/logo.png’, ‘bguru_vimeo’=>”, ‘bguru_skype’=>”, ‘bguru_dribbble’=>”, ‘bguru_slide_one_image’=>”, ‘bguru_slide_one_heading’=>”, ‘bguru_slide_one_text’=>” ); add_option(‘bguru_options’,$default_options); register_setting(‘tgbusinessguru’, ‘bguru_options’); } add_action(‘admin_init’, ‘bguru_register_settings’); function bguru_register_options_page(){ add_theme_page(‘Business Guru Options’, ‘Theme Customizer’, ‘edit_theme_options’, ‘bguru-options’, ‘bguru_options_page’); } add_action(‘admin_menu’, ‘bguru_register_options_page’); function bguru_options_page(){ $options=get_option(‘bguru_options’); ?> <div […]

Extend plugin options page

I had recently installed Post Views Counter plugin, which created an options page under the WordPress Settings menu. Now, I’d like to extend plugin functionalities by adding few more options. It will do by another plugin which has been created by me. The target is to add my own options directly into the page where […]

How to get option values set from all sites within a Multisite setup?

I created a plugin that is used on every site within my Multisite setup. Within this plugin I have an admin setting page that allows each site to set the options according to the sites needs. Each site saves its data with the add_option() function. How do I query all the custom options values from […]

Admin page repeatable fields

I have a submenu page set up and I want to add repeatable fields to it. The submenu page is to add staff holidays (fields will be Start Date, End Date and a multi select to pick the staff members name). Setting up the first lot of fields is not a problem, however, I want […]

Editor role cannot save custom theme options

There’s a few questions on this site referencing this issue and I’ve read them and applied the proposed solutions to no avail. I’ve made a very simple theme options page that appears for the Editor role but when an Editor tries to save the options they get the “Cheatin ‘Uh?” message. The following is my […]

Add update notification bubble to admin menu item?

I have re-worded this to make more sense. Ok, I have a plugin that uses a remote service that check for updates, much like default WordPress plugins, in this case it just checks an XML file. I want to show a menu bubble like this when an update is available. It can show just a […]

Are all options loaded to memory on each request?

Are all options variables fetched from the database and loaded to cache on each request?