Questions tagged [wp-options]

The Options API is a simple and standardized way of storing data in the database. The API makes it easy to create, access, update, and delete options.

Filter by
Sorted by
Tagged with
1
vote
1answer
25 views

How to add a default value to get_option if it's used as a variable?

How to add a default value to get_option if it's used as a variable ? The code : $my_options = get_option( 'my_options' ); // Associative Array 'my_options'. <div id="identifier" class="...
0
votes
0answers
7 views

Save multi-inputs as nested-array with options.php?

I'm building an admin-page under tools.php and am looping our data and some text fields, I would like to know if it's possible to save text fields with the same name as nested-array saved to options....
0
votes
2answers
29 views

i do not see the “site url and home options” under Wp_Options (phpmyadmin)

I wanted to show you this issue. This is happening first time with me in my 10 years career, I have cloned many sites to another domain in past but this is for the first time when I do not see the "...
0
votes
1answer
35 views

Whitelisting items from custom options page

I'm a relative beginner, so anything that points me in the right direction is appreciated. I'm trying to whitelist options from the admin panel. I have an array in another file (item-whitelist.php) ...
0
votes
0answers
119 views

wp_options Table keeps growing

wp_options Table keeps growing. I few days ago this issue started on my blog. I though it was a plugin problem but couldn't find a way a out so I delete it everything, wp, database, all. New ...
0
votes
0answers
19 views

How to store colorpicker hex color using options API?

I wrote the following code, which works fine in displaying a hex value if its not set, or if its set already. I want to save the selection of the colorpicker, using the save button, but something is ...
0
votes
1answer
78 views

checkbox with get_option not working

I am trying to figure how to have check box implemented in options page . i am able to get the default values but not save and retrieve it . i am using get_option() and checked() functions <form ...
0
votes
0answers
44 views

Some entries delete_option doesn't work

I use delete_option to delete all my database options when my plugin is uninstall or when users click a button: Remove all settings and cache <form action="<?php echo admin_url('admin-post.php')...
0
votes
1answer
24 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 ...
0
votes
0answers
14 views

Wordpress Option is cleared when updating from Admin Page

I am building a custom admin panel theme options page. So far parts of it are working. I used the codes below to register and build the admin panel form. Similar code is used for 4 different tabs. 2 ...
1
vote
0answers
14 views

ERR_TOO_MANY_REDIRECTS when i config my subdomains

I use multisite like this 144.1.1.3 and 144.1.1.3/another_site I need to use two subdomains like this mysubdomain.mysite.com.br for 144.1.1.3 and mysubdomain2.mysite.com.br for 144.1.1.3/...
1
vote
1answer
29 views

using wp_sprintf at wordpress option page,

I'm using a custom option page to control default setting of my plugin, in one part I need to let the admin add a text which will be send through sms, I need using some predefined text (such as ...
1
vote
1answer
39 views

Parse form values before sending to options.php

I'm developing a custom plugin, which requires input of authentication data for a remote API, and this data needs to be saved. I want to encrypt it before saving to db. I've added a settings page, ...
0
votes
2answers
32 views

Custom Post Type featured option

I have created a Custom Post Type called Products. Now I need a functionality that will allow me to select or check a product as featured. There can be only one featured product. When one product is ...
0
votes
0answers
152 views

Strange Behavior with update_option

If I run the following code in the debug console on my WP install, I get the expected behavior: <?php $option = get_option('fun_options'); var_dump($option); $new = array(); update_option('...
0
votes
0answers
33 views

Protect WordPress option value

I'm working on a plugin and users need to create and store some unencrypted credentials in wp-options. The credentials in question are service keys for google server to server API which is just a json ...
1
vote
0answers
36 views

options-general.php page displays different sitename, home compared to wp_options table

I was assuming that options-general.php page should display wp_options table contents. I understand that this is a naive interpretation of the implementation. Question: can someone explain the ...
0
votes
1answer
19 views

sudden changing of host IP result in crash of the site

I have the same problem and the answers which are given above didn't help me, so I explain my situation: My wordpress site is installed on ubuntu 14.04 on vmware This local host IP was 192.168.153.134,...
0
votes
0answers
38 views

How to store multiple instances of the plugin's options for various shortcodes

I am so new in WordPress plugin development. I have a plugin options page that contains one text field and one button. So when a url is given to the text field and stored with the button, using a ...
1
vote
1answer
135 views

What to use , set_transient, set_option or file system? [closed]

I have a shortcode that can parse page contents. For example you give it a link to a GitHub md file , it reads it and saves the page content for you. $parse_atts = array( 'id' => $id, ...
0
votes
1answer
660 views

Adding a checkbox field to a (custom) taxonomy

I've searched and found many variations on adding custom meta to taxonomies - often its just for text fields and often to store a whole array of options. One thing I haven't found is a way to ...
1
vote
1answer
287 views

How can I make my options in an array and store theme in WP options one DB row?

I am making a theme with theme options but for customization, I have completed my theme options more than half. Suddenly I have triggered one problem and that is I have checked my wp_options DB I have ...
0
votes
1answer
149 views

problem with get_option in dashboard

I have created simple plugin which transfer the html code from text-area in dashboard to front-end page where function defined in the plugin is being called to render the front page. However i have ...
2
votes
2answers
650 views

Editor role not saving settings page for custom post type

I currently have a custom post type with a sub menu page via add_submenu_page. On this page I have a form with some basic settings such as a text editor and some radio buttons. function ...
0
votes
0answers
100 views

Change database image location for transportability

The problem: the worpress site is developed locally by my team. When we finish, we will put it online. Now, changing the siteurl, home and ossdl_off_cdn_url in the database table wp_optionsis easy to ...
0
votes
1answer
92 views

Options site set empty fields after submitting

add_action( 'admin_menu', 'fhwtest_plugin_menu' ); function fhwtest_plugin_menu() { add_menu_page( 'Reservierungs-Einstellungen', 'Reservierung', 'administrator', 'fhwtest_reservoptions', '...
0
votes
1answer
192 views

Create a counter variable in wp_options that increments when submit button is pressed

I'm a php beginner. I have an order form on my site (NB: the form is generated from a custom products plugin). I want to create a reference code whenever a user submits, now I need help with creating ...
1
vote
0answers
382 views

wp_options siteurl and home hardcoded?

We received a WordPress site from the marketing team of our company and we successfully managed to get it up and running on a staging server but, we have now moved it to production and realized that ...
2
votes
1answer
517 views

What is the correct form action URL for network options pages?

Referring to Settings API in Multisite - Missing update message It states that: For network option pages the correct form action URL is: wp-admin/network/edit.php?action=your_option_name ...
0
votes
1answer
190 views

How to set a default theme option after installing theme?

I'm using a class to add a theme option page to my theme. I need to set some default values upon theme activation or installation, since some of these values are strings, and if i try to get the ...
1
vote
0answers
61 views

What is the correct way of updating wordpress options

I've added some codes to my theme's function so when I activated the theme, it will update the category base, permalinks, and post_per_page, and they worked perfectly fine. However, since I'm just ...
0
votes
2answers
3k views

My options table is huge. What can I do?

My options table is 3.2 GB! I ran a query to delete transients (only 172 were there), and I repaired and optimized the table, but it barely made a change. How can I go about finding out what's making ...
1
vote
1answer
498 views

My WP_options db rewrite_rules Does Not Work

On my site, I have my own custom php file that handles URL GET requests. For example, at mysite.com/?burger=WellDone, it will query my db and display a page with all burgers with "WellDone" in the ...
3
votes
0answers
451 views

Updating users_can_register option?

I have a custom setting page, where i have a radio to Enable or Disable Registration then try to update the wpoption (users_can_register). Screenshot: I've tried both true/false & 1/0 but it ...
2
votes
1answer
249 views

Enable/Disable WP options programmatically

o/ SO So I'm working on a plugin, that i use together with all my themes, where i have added a little option page. From my option page i would like to be able to disable stuff like WP_DEBUG, ...
1
vote
1answer
53 views

Pulling Data from CSV vs. pulling data from database

I developed a custom post type with a custom taxonomy for my WP theme and I need to add a number to associate with my taxonomy. Example: The taxonomy is "store" and the average savings for that ...
0
votes
1answer
124 views

Custom plugin admin page issues

I have created custom plugin to add admin page as shown in screenshot below. I am getting the following warning: Warning: call_user_func_array() expects parameter 1 to be a valid callback, no ...
2
votes
4answers
148 views

Any way to partition wp_options?

I'd like let some functions in my functions.php file use update_option() to save some local data, but the wp_options table seems to be global to every piece of software on my site, so I have to give ...
5
votes
1answer
118 views

Indexes of widgets instances starts with '2' in 'wp_options' table

I have interesting question about widget instances saved in wp_options table. I have spent pretty much time until I figured it out but still don't know why is it happening. Problem: So the problem is ...
3
votes
1answer
346 views

get_option() from another wordpress site

I'm using a plugin on Site A that shows announcements. I would like to put the same plugin on a different site (Site B), and have it pull the data from Site A, so that both sites show the same ...
0
votes
0answers
104 views

database - multiple wordpress installations using same database - can they share plugin settings?

I have multiple Wordpress installations sharing a database. They are also sharing the same wp-content folder. Is it possible for the sites to also share the same plugin options? I found a method for ...
0
votes
1answer
538 views

batch UPDATE autoload value in wp_options table

After running the following query SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'; I've found I got 1587 autoloading options values, mostly belonging to custom fields values; ...
0
votes
3answers
1k views

wp-options keep crashing please help

My wp-options keeps crashing and am getting "error establishing a database connecting" when I try loading the page. I don't know whats causing this to happen, I read somewhere that I might need more ...
0
votes
1answer
48 views

AJAX save options inside class

I am creating a theme options page but with object oriented approach. Every new instance of this object is a separate subpage. Rendering and all the options work fine (still in progress, but in a ...
-7
votes
1answer
161 views

Upgrade 4.5.2 to 4.5.3 deleting row in wp_options table

In performing the upgrade from 4.5.2 to 4.5.3, a single row used by a plugin is deleted which contains all the data for the plugin. I'm digging through the upgrade and I don't see anything that ...
2
votes
2answers
666 views

wp_options table has duplicate rows and primary key / autoincrement has been removed

I've noticed that in my development instance of Wordpress that wp_options contains duplicate rows. After some more investigation I found that the primary_key and auto_increment restraints were removed ...
1
vote
1answer
42 views

add tabs in rdp-plugin/includes/settings.php and get settings saved

In my plugin settings page i have to add a lot more settings. To get it correct I need some tabs for better understanding. Here a screenshot as I add it with simple html coding in my rdp-plugin/...
0
votes
1answer
57 views

WPML admin texts with serialized objects

I have been trying to get a plugin to work with WPML - I'm almost there but I'm wondering if anyone knows if it's possible to get WPML's admin texts (wpml-config.xml) to read serialized objects stored ...
0
votes
1answer
33 views

How to reinstate previously saved option?

I am working on a simple plugin (kind of maintenance plugin) where I am updating the homepage based on user page option choice. function set_hp(){ $page = get_option('get_the_page'); if ( $page ) {...
1
vote
1answer
318 views

Best possible way to get all options

I need to provide a list of all options set via plugins etc to remote calls. There is a plugin WP API Options but it hardly does the job. There are two possible ways (that I know of) to get a list ...