Questions tagged [plugin-options]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
11 views

Trouble trying to automatically save checklist items which clicked

I am trying to save the values of multiple checklists using update_option and individual options for each item. I am getting a 400 Error in the console when making POST requests to /wp-admin/admin-...
Joshua Healey's user avatar
0 votes
0 answers
50 views

update_option with array_push adding mutiple copies

A plugin I'm working on checks if an option exists. If it does it will update that option by adding new values to the array. When I var_dump the new option value looks great, but when I check the ...
Stickel's user avatar
0 votes
0 answers
23 views

Plugin forms overwrite each other's options

I am creating my first WP plugin, where I have two forms. Both work correctly, but when I save the information from one, the information from the other disappears. I'd like to save all options in one ...
Rufi's user avatar
  • 1
0 votes
0 answers
35 views

WordPress plugin options page not saving options, no errors

My plugin's options page has two string options: username and access_key. When I enter my username and click "Save Changes", the page reloads, but the username is not present in the option ...
Steve's user avatar
  • 1,677
0 votes
1 answer
92 views

Update option hook not firing

I've added an options page using this: add_options_page( $title, $title, 'read', 'wp-video-reviews-licenses', array($this, 'render_licenses_menu') ); Then in the callback: public ...
sfarzoso's user avatar
0 votes
1 answer
23 views

wp_options not returning value for logged out users?

I have saved my custom plugin settings inside wp_options table, but when I try to access them using "get_option" function it returns me undefined for logout users, but when I logged in it ...
Talha Arif's user avatar
0 votes
1 answer
37 views

Why aren't these WordPress options being saved to the database correctly?

I have a plugin for editing certain options already stored in the database. It creates an options page under Settings with a simple form that populates each field with whatever values are stored in ...
soupmagnet's user avatar
0 votes
2 answers
77 views

How to add new options to my WordPress plugin

I'm the author of a small and simple WordPress plugin based on WodPress Plugin Boilerplate using WordPress Plugin Boilerplate Generator. My plugins is Language Switcher for Transposh: it just allows ...
Marco Gasi's user avatar
0 votes
0 answers
84 views

how to show new field if option selected?

I have this code for create setting page for my plugin. with this code , i show two field in plugin setting for change style and set shadow on/off. In style section i have 4 option and i want show new ...
masoud nkh's user avatar
0 votes
2 answers
71 views

Gathering and logging data from a plugin: how to do it without race conditions?

I have a need to capture data in a WordPress plugin and append it into some sort of log. The data I want happens to be slow SQL queries from $wpdb->queries. I'm hoping to present useful "...
O. Jones's user avatar
  • 471
0 votes
1 answer
300 views

Make inline uploader (plupload) on options page upload to a specific folder

I’ve set up an options page for my CPT that contains the drag'n'drop upload area (just like Media → Add New). Basicly, I’ve copied all the relevant stuff from wp-admin/media-new.php and it works like ...
mischnu's user avatar
  • 11
0 votes
1 answer
165 views

Save Plugin Options as Array

I am trying to create a simple option page. The options consist of a text field per user role. But I don't want to edit the code every time I add a new user role. So I am trying to "for each"...
Fredrik's user avatar
  • 156
0 votes
1 answer
2k views

How to save custom form data in wp_options table

I have some data that I want stored in the wp_option table. I know the code is not right but I want to store data in this way: global $wpdb; if (isset($_POST['add_estimated_satisfaction'])) { // ...
DK Thakur's user avatar
  • 149
0 votes
0 answers
182 views

update_option() passing empty array() but still updating

I am reviewing some code in a custom plugin but I am not understanding how it could be working. All form fields are indexed by name="opm_settings[name]" At the top of the page inside the ...
php-b-grader's user avatar
2 votes
1 answer
93 views

Performance of several get_option() calls

I am currently working on my first WordPress plugin. To save and output certain settings I use the native Settings API. Now the question arises, how performant are several calls of the get_option() ...
Jonas's user avatar
  • 159
0 votes
1 answer
88 views

Multiple checkbox doesn't work in wordpress settings api

I was creating a checkbox of roles n WordPress. I successfully generated them but the checked function doesn't seem to work. Also, it is throwing this warning. Warning: Illegal string offset '...
Raashid Din's user avatar
0 votes
1 answer
164 views

Custom plugin: how do I call a PHP file if settings option is set to true?

I am making a custom plugin with various functions that do different things. I have created a settings page using the Settings API to save data to the options db. That works fine. Now I'm trying to &...
Michael's user avatar
  • 281
2 votes
1 answer
325 views

Is it ok to call get_option without hooks?

Many plugins call get_option() to fetch their settings right in the main plugin file, without using any action hook. Is this the way it is meant to be used? I am asking because it seems to me that ...
coccoinomane's user avatar
0 votes
4 answers
742 views

How to automatically redirect to custom admin menu after plugin activation?

I need a function to redirect user to the plugin settings page, right after plugin activation. I use this function to create a custom menu settings page: // add option page menu link function ...
Knott's user avatar
  • 454
0 votes
2 answers
41 views

Plugin Options not being output

I've been making a plugin for wordpress that adds two simple text field options. The options are saved successfully in plugin options page but don't work, it doesn't output saved options. Here's the ...
Knott's user avatar
  • 454
2 votes
2 answers
206 views

WordPress setting with select - where is my mistake?

I have two option callbacks in my plugin, one with a ckeckbox and one with a select field. The first one is working perfectly, the second not. The select field doesn't save its value. I double checked ...
t3chernobyl's user avatar
1 vote
0 answers
125 views

Add Plugin options as subpage to Theme options page

I have my own Theme with an options page. Now I am developing a new Plugin which should have an options page that should be a subpage of the Theme options page. Theme options.php: <?php function ...
toneyt's user avatar
  • 41
1 vote
0 answers
34 views

Addition of custom option panel crashes Media Library & Admin Area

So, I was carefully following the Wordpress Codex to create a Custom options panel for a custom post type.(https://codex.wordpress.org/Creating_Options_Pages) Specifically, Example 2. Everything was ...
Kevin's user avatar
  • 27
1 vote
1 answer
1k views

Error: options page not found when I try to save the changes made in my settings page

I'm developing a plugin... everything was fine but suddenly when I try to save the plugin settings... I found with the error that says the page options not found.. I was looking for some answer but ...
Ezequiel Cattaneo's user avatar
0 votes
2 answers
3k views

How to get data from option page [closed]

https://codex.wordpress.org/index.php?title=Creating_Options_Pages&oldid=97268 This page shows how to create options pages. // theme-settings.php <?php add_action('...
Ibrahim Al Khalil's user avatar
0 votes
0 answers
109 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 ...
DannyBoy's user avatar
  • 121
3 votes
1 answer
980 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 Note: ...
jgangso's user avatar
  • 1,413
0 votes
1 answer
100 views

CMB2 - array_search or in_array from repeat_group and comma separated values

I have this data coming from $myoptions = my_get_option('my_repeat_group'); $p = 'T1X 0L6'; // find me print_r($myoptions) = Array ( [0] => Array ( [region_name] => Alberta [postal_codes] =&...
Ray Flores's user avatar
0 votes
1 answer
34 views

Populate Dropdwon with DIR files, save value and keep it "selected"

i have a dropdown list which gets populated by the content of a folder. When i save the page, the dropdown resets and does not show the selected image. Other options on the same page (color/text..) do ...
Daniel's user avatar
  • 1
0 votes
1 answer
95 views

Output checkbox per user and save in plugin options

I am looking for a way to save my list of checkboxes as an array within the settings_fields of the plugin. I currently have: <?php $WPusers = get_users( 'orderby=nicename&role=administrator'...
Erik van der Bas's user avatar
2 votes
2 answers
328 views

Settings API - input always updates over validation

I am following a Wordpress book and am trying to create a plugin and have got an option page showing. In this page I have two text fields (which values are stored in one array). I am trying to add ...
thairish's user avatar
  • 213
2 votes
1 answer
3k views

Using Checkboxes on Plugin Options Page for Custom Plugin

I am creating my first WordPress plugin. It is a simple plugin that extends Visual Composer allowing you to remove the element options in VC (shown in the screenshot). On the plugin "options" page I ...
cpcdev's user avatar
  • 387
1 vote
0 answers
1k views

Create tabs in admin options page from custom post type loop

For a WordPress crm/password management plugin I am working on, I have created a custom post type called 'client'. I also have made a separate menu page for storing and showing the passwords of these ...
Justin's user avatar
  • 45
0 votes
1 answer
65 views

Create a select metabox that the user can pupolate?

I have been working on a plugin that uses text area metaboxes on an options page to populate drop downs in the CPT area. I was with the help of some others able to get the list to show in the select ...
John Lucey's user avatar
2 votes
2 answers
603 views

Creating Admin Options Page where users can make changes to a theme

I need help to finish this last bit of php code. I'm trying to create an admin options page similar to in admin>settings>discussions like how a user can select an avatar, but instead of selecting an ...
user3438958's user avatar
0 votes
1 answer
46 views

Theme options are they necessary

So I have decided to use wordpress for a site. But just as I begun I realized that I might need options. Things as simple as logo, favicon and possibly some parallax settings. Is it necessary to have ...
SharpCode's user avatar
  • 123
0 votes
1 answer
99 views

Warn user that data may be lost for custom pages

When you edit a builtin field in Wordpress like the title and don't save the cahnges, and attempt to go to another link, a warning alert box comes up stating that "changes may be lost if you navigate ....
Yahya Uddin's user avatar
-2 votes
1 answer
579 views

When is it OK to create a custom table for a plugin? [duplicate]

A while ago I wrote a question asking about storing easily queryable data associated with a given attachment. The recommendation that I received at the time was that I should avoid using the WP ...
Dan's user avatar
  • 887
0 votes
1 answer
27 views

Plugin options not appearing on options page using tabbed navigation

I've modified the plugin options page for my plugin to use tabs, using the existing WordPress system for this. However, The actual options are not appearing on the screen - just the tabs and the "Save ...
Christiaan's user avatar
1 vote
1 answer
951 views

Change custom post type slug from plugin options

I'd like to give users the option to change a custom post type slug in my plugin. Using this answer, I'm able to hardcode it into a function: Redeclare/Change Slug of a Plugin's Custom Post Type ...
joshuaiz's user avatar
  • 115
0 votes
1 answer
4k views

How to retrieve the options from this options page?

I like to write a plugin with an options-page from the WordPress-Codex, but I cannot retrieve the options. get_option('your_option'); does not work. Here is the options page code: <?php class ...
AndreasHecht's user avatar
2 votes
3 answers
3k views

How to update selective options on plugin settings page

I write a wordpress plugin. My plugin has options. All options are in one group, 'pluginname-settings'. All option names are uniform and look like "pluginname-settings['option-name']". Some code to ...
Eques's user avatar
  • 45
0 votes
2 answers
5k views

Export and import all Plugin options

Actually I am developing a new free plugin for Wordpress partially based on this plugin FrameWork: Sunrise framewok, each option's name will start like this: my_plugin_ So everytime i need to echo ...
Downloadtaky's user avatar
1 vote
1 answer
5k views

Serialize data for wp options

I am creating my first ever plugin, its purpose is to show a notice when some conditions are met, I created the function in jQuery and initially I had to manually edit the file everytime I wanted to ...
David Garcia's user avatar
0 votes
1 answer
208 views

What could cause a WP Option to get truncated?

I have a WP plugin, where all admin setting field values were suddenly changed to the letter 'a'. All settings are stored in one 'big' option in the table. Seemed like the serialization gone wrong. I ...
Firsh - justifiedgrid.com's user avatar
0 votes
1 answer
117 views

Include paths and functions for external scripts

I try load external script as plugin , the idea it´s use one easy plugin and call script and load this script into admin but i have problems with some configuration files and css files , in the case ...
Fran's user avatar
  • 61
4 votes
1 answer
15k views

Save and retrieve custom plugin options value

I want to save the value of input data and retrieve it, I have gone through the tutorial of otto press. I'm new to creating WordPress plugin and what I can't understand is once I click the Save ...
Arish's user avatar
  • 41
0 votes
1 answer
470 views

Is it possible to set a option, and then redirect to another page directly from a admin notice link?

I like to execute a update_options() and stuff and then redirect to another plugins page? Directly after the user clicks a link in a Admin notice. How would i do that? Ajax? Is that even possible?
James Mitch's user avatar
1 vote
1 answer
123 views

How to prevent options.php deleting valid existing data from the database

I am setting up a plugin and have used the setting API for the first time to create a form in settings. The data for the plugin is initially created by default when the plugin is activated and stored ...
Pete Lawless's user avatar
4 votes
3 answers
1k views

Save Plugin Version Number as Option?

I seem to recall seeing a tip somewhere saying that it was a best practice to save a plugin's version number as an option. I'm working through releasing a plugin, and I'm considering whether to do it, ...
mrwweb's user avatar
  • 10.2k