Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

In WP `options` is the term used for variables stored in the database. They are accessed through the options API.

0
votes
0answers
31 views

Woocommerce or Wordpress , changing default settings

Im looking for a solution to change default settings, for example: In the picture you're seeing (attached) Default = Enable And i want Default = Disable i want to set default to disable, ...
1
vote
0answers
16 views

How to change user admin_color with WP CLI?

I like to know how I can change a users admin color theme with WP CLI.
0
votes
1answer
18 views

How to save the option's new values plus old value without overwrite old one

i have just tried this function myplugin_update_field_foo( $new_value, $old_value ) { if ($newvalue !== $oldvalue && !empty($oldvalue)) { $newvalue = array_unique( array_merge( $newvalue, ...
3
votes
1answer
41 views

Multisite: How to store global options vs. site options?

Hey there I am pretty confused on how to store network wide options within a WordPress multisite installation. The usual way to store any settings in WordPress is: add_option(); update_option(); ...
0
votes
0answers
22 views

options.php not found when saving Theme Settings

I am building a custom theme from the Underscores starter theme (https://underscores.me/), and am building a theme settings page. When I go to save my fields, I get the "Error: options.php not found" ...
0
votes
1answer
12 views

Add option for editors through `register_setting`

I want to add some options in wordpress admin panel which editors also can update through a form. I have used register_setting() function to add those options. For administrator this works fine, but ...
1
vote
1answer
14 views

Add New Sub Site from the WordPress back end then in sub site options table option_value must be with https

I installed multi site setup for the domain https://uninfo.org but when i add new sub site from the back end it is creating but in sub site WP-options table it created with HTTP rather then https ...
0
votes
1answer
17 views

How to add the option to choose between sizes for featured image within post editor?

Drew a blank Googling for this... Our website homepage shows a grid of featured image thumbnails on the home page. Some of these images are portrait and some are landscape. I would like to be able ...
0
votes
1answer
21 views

WP options plugin setting not saving the selected checkboxes

I am trying to make a plugin, so far everything is working, the problem is when its time to "save changes" the text are saved but the selected 2 checkbox didnt save so both remains unchecked. Heres ...
0
votes
0answers
14 views

Options API - Validation Callback $input is NULL

Issue is that the validation callback function for my plugin has NULL as the $input value. It's my understanding that the validation callback will use the $input parameter, which contains the POST ...
0
votes
0answers
21 views

Enable plugins that are “not supported”

I just create a clone of a website with All-in-One WP Migration, the original site being hosted on wordpress.com. Since wordpress.com is a typical managed WordPress provider, it allows only for a ...
1
vote
2answers
42 views

In db https is used for home, but in backend http is used and cannot be edited

I switched my web from http to https by using "Better search and replace" and everything worked fine - at first sight. All resources were deliverd via https and the Firefox showed a green lock. But ...
0
votes
0answers
37 views

Options saved and called in wrong order

for a plugin i am creating i want to execute a function only when the specific options is updated to save ressources. It works so far, but the hook update_option_{$option} should normaly be fired ...
0
votes
1answer
32 views

Get Data From wp_sitemeta for Multisite network

I have a multisite network with around 30 sites on it. In the wp_sitemeta table, there are some options the previous dev had set (one of which is 'template_color'). So in the wp_sitemeta table, ...
0
votes
0answers
93 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
0
votes
1answer
65 views

How to store a value on WP_option table

<?php function myplugin_register_settings() { add_option('marker_pin',''); register_setting( 'marker_group', 'marker_pin', 'myplugin_callback' ); } add_action( 'admin_init', '...
1
vote
1answer
276 views

What ALL can cause “Another update is currently in progress.”? [closed]

I have been digging through stuff and I can't seem to find any other reason for the "Another update is currently in progress." To clarify I have already tried the Fix Another Update Is In Progress ...
0
votes
1answer
59 views

Custom post type option page template

I'm making a website which has a page that contains all members. So till now I've made a custom post type using the following code: function midas_team_post() { register_post_type( 'midas-team', ...
0
votes
0answers
24 views

Where to store user data for my slider plugin?

I'm building a slider plugin and having a difficult time deciding how best to store the user inputs. My idea is that the plugin will allow users to create and store multiple sliders. Each slider ...
0
votes
1answer
14 views

Function to incorporate an option in each Page

Hello (sorry for my bad english). I have searched but not found what I want. I would like to know if there is a possibility to incorporate an option for each page. Something like in the Customize. ...
0
votes
0answers
22 views

Use delete_option in action link

Is it possible to use delete_option in an action link directly? Currently, my thoughts are to add a page named reset.php and link to it. This is not the same as a uninstall. The link would look like ...
0
votes
0answers
226 views

Woocommerce Variation dropdown <select><options> doesnt allow arrow key navigation

On all my woocommerce websites. Product variation dropdowns do not allow arrow keys to navigate once selected. For example if you select an option from the dropdown. It "unselects" itself. If you ...
0
votes
1answer
430 views

Update siteurl and home in multisite subsites to https

I want rewrite the siteurl and home options on multisite subsites. In wp-admin/option.php this is it: if ( !is_multisite() ) { if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'...
9
votes
2answers
645 views

Is get_option() faster than accessing get_transient()?

Today I run a test over my db to explore the speed difference between accessing a key from options, custom table & transients. I ran the test for 1000 times and following is the time taken to run ...
0
votes
1answer
18 views

not getting API setting saved confirmation message after update on option page

I am able to add option page to dashboard Menu and so far it works properly (at least to me) But I am not getting API Setting Saved Message after updating the page add_action( 'admin_menu', '...
1
vote
1answer
52 views

How to add values to media “whitelist_options” in wp-admin/options.php template?

I would like to set default values of the media variables on my multisite. If I want to do this on one site, it's a simple thing, I add values on mysite.com/wp-admin/options.php to the ...
0
votes
1answer
20 views

Wordpress Boilerplate Plugin doesn't see callback functions for add_settings_field and add_settings_section

I am developing my first plugin, and I have an options page setup. Now, I am trying to add some fields. I have this in xxx-admin.php in admin folder public function section_callback() { echo ...
0
votes
0answers
33 views

How do I add a textarea (multirow) option to my Wordpress plugin?

I'm getting a little confused between the options and settings APIs. I want to add three multirow text fields (displayed as a textarea) for my plugin. I just want to allow the user to specify three ...
0
votes
1answer
147 views

Echo Option Value Based On Wordpress User Role

If someone can figure this out, man you would make my week! Basically what I'm trying to do is echo a different value in a option based on a the users role on Wordpress. If user is administrator ...
0
votes
2answers
21 views

Plugin scheduled event not working

I have created this interval in my functions.php: function minute_interval( $schedules ) { $schedules['minute'] = array( 'interval' => 60, 'display' => __('Every minute') ); ...
0
votes
1answer
234 views

Custom delete option button in plugin settings

I would like to add Delete button next to my file Upload option in my plugin settings. At this moment I am using Settings API, using form below. <form method="post" action="options.php" enctype="...
0
votes
0answers
12 views

Is there a options api element of table?

I need a dynamic table of values saved to each user profile. Only issue is they cannot edit the values inside the table, but they can fire a search event from a button click, or delete the searches if ...
0
votes
1answer
180 views

Custom Plugin Options Won't Update

We wrote a small custom plugin for a client to pull some custom options (set in the WP dashboard) to be used to calculate custom shipping costs in Woocommerce. The issue right now is that changes to ...
0
votes
0answers
21 views

Should I still use Settings APIs?

I'm writing a countdown timer plugin for WordPress. I want users to be able to add it to a post using a shortcode, like so: [countdown-timer preset="user-defined-preset"] Basically, it's going to ...
0
votes
0answers
164 views

Yoast SEO - updating titles and descriptions causes 403 or 404 error

Some weird things are happening on my website. When I try to save any options in Yoast SEO (connected with e.g. XML maps, social things, advanced settings), everything is fine - besides "wpseo_titles" ...
0
votes
0answers
93 views

update_option and the option cache

Ive been doing some reading regards wordpress and its options table. Im aware that all options ( with autoload active ) will load into the cache on page load to avoid multiple database hits. What im ...
0
votes
2answers
76 views

Run query on specific admin options page and send results to select field in another function

How do I run a get_posts query on an individual options page for my plugin and send those results to another function to populate the select fields? I'm building a custom plugin that builds a vcard ...
0
votes
0answers
27 views

Settings Page doesn't save settings to Database

I'm making a very simple plugin that adds a menu item under Settings and an options page with two textareas that add header or footer scripts. The Admin Menu link displays and the "Add Scripts" page ...
0
votes
0answers
21 views

Registered sidebar area is not shown from plugin.

I am trying to list all registered sidebar. But while I put the code inside plugin it does not work but if I put it inside theme it works. function chup_list_sidebar(){ $sidebar_options = array(); ...
0
votes
1answer
41 views

Override plugin option by with a custom theme

I'm creating a custom theme and using one of video embedding plugins from the market. There are plenty of options and among them "don't load css style", is there a way how to make it always checked ...
0
votes
2answers
46 views

Can I use register_settings and unregister_setting once the settings page has loaded?

I want to add few settings fields dynamically on settings page depending on user action. I am planning to register these new fields dynamically once user asks for it and show the corresponding HTML ...
0
votes
0answers
16 views

Issues with overwhelmed autoload

I'm not a developer but understand som basics of WP development. I have a site hosted at WPE, which initially was very fast but after some tweaking and twisting on the site, the frontend and backend (...
0
votes
0answers
26 views

When storing small amount of data should I use Option, Settings API or custom table?

I am relatively new to WordPress and saw some of related questions but they where mostly old. Not sure what is the optimal way to store data in the current WordPress version. I need to store a list ...
0
votes
0answers
404 views

add image in dropdown select

if (!function_exists('dropdown_categories')) : function dropdown_categories($show_option_none, $name, $selected = '') { if (of_get_option('blog_cat_id')) { return apply_filters('...
0
votes
1answer
436 views

How to save plugin custom settings page fields

I want to implement a plugin which gets 2 fields in admin area and saves those in options as array I read the page Custom Settings Page but seems it doesn't describe how to save fields values in ...
1
vote
1answer
87 views

Work flow for multiple developers

I'm looking to streamline the development work flow for a new project that will have multiple developers involved (backend and frontend). My biggest quandary is how best to make sure all devs have ...
1
vote
1answer
107 views

Storing product price data in the database

I am writing a Wordpress plugin to store product data that is pulled from the Amazon Affiliates API. My goal is to have an admin page where I can add new products and view/edit/remove existing ...
1
vote
0answers
188 views

Options API get_option() and update_option() Not Correctly Updating or Returning

Consider the following code: if(!class_exists('Update_Option_Error')){ class Update_Option_Error { public function __construct() { ob_start(); // This ...
0
votes
1answer
58 views

update_option does not work in this scenario - how do I fix?

I am attempting to use update_option to add or update an option. I have created a test below which creates a settings page and when loaded it runs my awd_do_sync function, but the option does not get ...
0
votes
0answers
43 views

Post being duplicated with foreach loop

I am trying to create posts from options in the database, but I am getting duplicates of the posts each time I run the function even though I have added a conditional to check for duplicates. Here is ...