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
15 views

Editing cron timestamp in wp_option table

Let's say I have a multisite with ~1000 blogs. One of the plugins triggers an action once a day using wp_cron. The issue is that this triggers on all sites at around the same time, slowing down the ...
0
votes
1answer
10 views

Is there an optimized, WordPress-y way to not call a `get_option` twice?

I'm currently trying to get an option and if it's not present, simply assign an empty array as this variable: $option = get_option( 'option_name' ) ? get_option( 'option_name' ) : []; The problem is ...
0
votes
0answers
9 views

how to use a sidebar widget with its options in a template

I know that the title of this question is a litle confusing, but this the problem I have recently installed a widget called Youtube Channel Gallery, which displays the latest videos on my website. ...
0
votes
1answer
19 views

Button to clear transients

I would like to add a button on the admin page to clear the transients I use. See my code below: <?php // If this file is called directly, abort. defined('ABSPATH') or exit(); /* * Generate the ...
1
vote
0answers
16 views

How to remove traces from widget during uninstallation

I have a small plugin, which registers a custom widget and now I am wondering how to remove all traces of this widget when the plugin is removed through the administration. If I look in the database ...
0
votes
1answer
18 views

Plugin Options Page and Subpage

I'm working on a plugin which it's options need to be managed by admins and super admins [yes, it's a network site]. the idea is that super users can create resources which are then enabled by the ...
2
votes
1answer
36 views

update_option_{$option} Too Few Arguments

Adding a callback to "update_option_{$my_option}" results in the error Too few arguments to function. My callback accepts $old_value and $new_value. If I remove $new_value from the callback ...
0
votes
1answer
23 views

Problem with Settings API: changes are not saved after submit

I'm writing a plugin "Paid Post" with some options. I made a settings page for my plugin, and it displays OK, but when I'm pressing "save changes" button, the option I have do not change, it just ...
0
votes
1answer
36 views

How to implement theme option to change bootstrap 4 container from .container to .container-fluid

Developing wordpress theme from scratch, I got some basics, but, as I start to make templates for changing the look of a page (like 1 or 2 or 3 columns, with or without sidebar...), an idea came to me ...
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
21 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
21 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
53 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
39 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
17 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
15 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
18 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
23 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
19 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
25 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
38 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
42 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
166 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
124 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', '...
2
votes
1answer
349 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
120 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
15 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
25 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
271 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
627 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
694 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
59 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
29 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
35 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
196 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
23 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
304 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
203 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
201 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
111 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
90 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
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
46 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
53 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
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 ...