Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms (1)

0
votes
1answer
69 views

Wordpress custom admin functions security

i have a case in my admin panel where i need to call my own function that resides in my own php file, with a GET request. This function is actually removing entries from the database. So, i would ...
1
vote
1answer
165 views

Is there a capability for managing plugin options?

I have an Editor user that I want to let use a plugin's options without being an Administrator. I can use $user->add_cap but can't tell if any particular capability relates to the permission to edit ...
0
votes
1answer
449 views

help using get_option

I got some code from this site which is going to work great for me. If ound it in another post. What I have modified it to do is add a text box in the category edit area so that the user can input the ...
1
vote
2answers
2k views

Add option to “Gallery Settings” section

I want to add a option to the "Gallery settings" (when you insert a gallery into a post). I once found some code on how to do this, but unfortunately I can't find it anymore. I can't even remenber if ...
1
vote
1answer
29 views

Editing options pages?

I'm trying to find a way of adding a single checkbox to one of the existing options pages, most likely options-reading.php programmatically. Unfortunately, I haven't found any good references on this. ...
0
votes
2answers
513 views

In widget, the value of select field doesn't get updated, changes after saving

I'm building a simple widget which will allow the user to select a post among a list of posts. For some reason, when I select an option, I believe it actually gets selected but the option doesn't ...
1
vote
1answer
65 views

How to Call pages from a Options Panel

Need a little bit of help here. I am adding this dropdown to my options panel. However, when I call my option in my template. It does not display Here is the function for the dropdown: function ...
0
votes
1answer
781 views

The Correct Way to Use Nonce Field without Settings API

I'm trying to create an admin option page without the Settings API for some reasons. Then if I do so, I've heard that I need to use nonces for security. I'd like to know the correct way to use them. ...
0
votes
1answer
515 views

Plugin options will not save in database

I'm not sure what's happening here, since this has worked in another plugin I've created. I'm simply trying to store data in the options table. Here is the code I'm using: function on_myplugin_start ...
0
votes
2answers
3k views

Efficient way of saving plugin options

I'm considering the saving of options for a plugin I'm developing. The first obvious candidate is the wp_options table. While reading the Pro WP Plugin Development book I came across this: Every ...
5
votes
2answers
694 views

Why does WordPress use serialize rather than json_encode for the options table?

I have a basic understanding of serialize (I come across it often when I'm migrating WordPress installs) and I just discovered json_encode. Given that serialize causes so much trouble with replacing ...
0
votes
1answer
106 views

Are there risks associated with using wp_options table using wpdb to update theme options

I am making a theme and it has so many options that need to be updated via jquery's ajax.Having looked at ways of updating wp_options via ajax,i have hypothesised that updating the wp_options table ...
1
vote
2answers
3k views

clean wp_options table unused rows

In my Wordpress Blog site i have installed too much plugin and remove also many plugins. In database table "wp_options" size increases approx 13MB and there are many rows which are unused at this ...
4
votes
3answers
2k views

Add on the fly tabs to plugin options

Hi I am building a plugin options page. What I'd really like to do is implement repeatable tabs (which I know is possible with the Settings API), but with a twist I haven't seen in any options panel ...
1
vote
1answer
367 views

wp_dropdown_pages() in theme admin page

Scratching my head on this one. I have a theme option page, where I need the user to select a page to show at X location. I am using wp_dropdown_pages() to list my pages, and they show. But, I can't ...
1
vote
0answers
296 views

WP-Super-Cache - generate cache programmatically [closed]

I wonder if there is possibility to generate WP-Super-Cache programmatically after the cache is being purged ( after I have published a new post ). I thought of writing some kind of crawler that will ...
0
votes
1answer
450 views

Google fonts dropdown in Options Framework

Is there a way to add a Google Fonts dropdown to the Options Framework panel (http://wptheming.com/options-framework-theme/)
1
vote
2answers
7k views

Contact form 7 select box different value-text then content-text in option [closed]

DSoes anyone know how I can set a different valute in the select-options in contact form 7 plugin? Here is an HTML example of what I'm trying to do <selct> <option value="1">My ...
0
votes
1answer
70 views

retain querystring values when savincustom options in admin

Quick question, I have a custom options page which posts to options.php, however I have a few sections to my options page where i change the post url like so: <form ...
0
votes
1answer
75 views

wordpress theme option in other templates

I am using word press theme option panel and using those in my header.php without any issues, code as follows... <?php // loading theme options. used in header.php global $options; ...
1
vote
2answers
179 views

Set front page option using custom fields?

Hello wordpress gurus! I want to be able to set the frontpage via a custom field. So for example, in the new page area in the wordpress admin there is a custom field that displays "Set as frontage", ...
1
vote
1answer
134 views

API for wp menu hacks

Question changed due to new developments! I was loooking for a way to hack the menu items in the custom menu page to add a "hide" checkbox and other options. The only way I found is to override the ...
0
votes
2answers
209 views

how to get the post id in the option tag

$term_id .= $_POST['main_brand_id']; $term = get_term( $term_id, 'state' ); $slug = $term->slug; global $post; $args = array( 'post_type' ...
5
votes
2answers
2k views

WordPress Theme Options Import/Export

I already have a theme options page that saves to wp_options > kittens_options. I'm looking for a simple way to incorporate an import/export textarea of those options on my options page. I've ...
0
votes
1answer
710 views

Saving multiple fields as array

I'm adding a settings section to a theme that will allow the user to enter testimonials which will be randomly displayed on the site. Each testimonial has 2 fields, author and testimonial, I've ...
12
votes
3answers
2k views

How to add Custom Blog Options to new blog setup form?

Seems like a simple enough requirement, but I'm struggling: I want to add an option field to the "Add New Site". A simple text option is fine. How do I do this? I need to save this custom blog ...
0
votes
1answer
290 views

Default Plugin Settings Not Writing to Database

I have my plugin setup as such: Main plugin file mouldings.php <?php /* Plugin Name: Moulding Profiles Plugin URI: Description: Creates a 'Moulding Profiles' and 'Idea Gallery' custom post ...
6
votes
3answers
338 views

Releasing new plugin version, how to rename old options keys?

I have everything ready for publishing a new version of my plugin but one last issue stands... The old version had no naming convention for its key option names. The options grew and I renamed all ...
0
votes
1answer
96 views

Need to add/remove group of options and display them as rows

I am creating a plugin which has 5 textbox for options. What I need to do is to treat these 5 options as 1 item, and being able to add more items. I've always worked with static hardcoded options for ...
1
vote
1answer
201 views

How can I show the contents of only a few users

I'm trying to show the contents only for certain registered users. All users have the role of "agent". To hide the contents of an unregistered user, I use this code: <?php if ( current_user_can( ...
2
votes
2answers
1k views

Get category slug and display it on a query_post

I just read "How to create option page for wordpress theme" in wp.tutsplus.com - I have a problem with getting categories . there is two parts to my question - Part A - Get category slug and ...
0
votes
2answers
209 views

Multisite Plugin - Access options (wp_options) on child sites

Is there a way I can access the wp_options table of all the child sites? I want to create a multisite plugin that can be setup at the network level and will populate the child site plugins with ...
0
votes
1answer
292 views

WordPress theme options tabs

It is possible to create tabs in admin panel in Theme options like in Theme? Please see this screenshot: I can't find any official documentation about adding admin tabs.
0
votes
2answers
615 views

When to use custom DB tables or add_option?

I've got a pretty straight forward question. When does it become too much data to use add_option, update_option, etc, and instead use a custom DB table? For example, if a plugin stores thousands and ...
3
votes
1answer
729 views

Settings API - save an array of options as one setting (array_push?)

1. Basic settings API callback. Using Settings API my $sanitize_callback validating function looks like: (...) if($type == "foo") { $valid_input[$id] = $option[$id]; } else ...
5
votes
1answer
1k views

Settings API - easiest way of validating checkboxes?

I'm using Settings API and I can't get checkboxes to work, if they're set to "false" they're not even being $_POST and that's the point. Stephen Harris & Chip Bennett explained it, but I believe ...
0
votes
1answer
275 views

Settings API - how to update options manually?

I'm storing all my options using Settings API: function registerSettings() { register_setting('XX_theme_settings', 'XX_theme_settings', 'setting_validate' ); add_settings_section('theme_options', ...
1
vote
1answer
146 views

WordPress Network admin options page: how to store options and where will they be stored?

I'm creating an additional WordPress Network admin page, and I need to store some system-wide option. The good thing that a config file will be generated, so no access is required from the child ...
1
vote
1answer
295 views

Settings API erases itself?

I have two forms created using Settings API, and when I save one of them the other one gets erased and vice versa. Here's the whole code so you could paste it into your functions.php file and see ...
0
votes
1answer
822 views

How to save Wordpress Options as an array?

How do I save options as an array using forms? I don't want to use Settings API. Here's working form that saves 3 options separately: <form method="post" enctype="multipart/form-data" ...
2
votes
1answer
2k views

How can you upload an image from within a settings page?

Is there an easy way to include an upload box to your settings page? I am building an Open Graph options page and I like users to upload a standard image directly from that page.
1
vote
1answer
845 views

Multiple options pages validation for a plugin

I am writing a plugin and I decided to have multiple pages for different options of the plugin (for clarity's sake). Doing a single option was a piece of cake, but I'm encountering difficulties when ...
5
votes
1answer
1k views

What's the difference between Options & Settings?

And which one should I use? What's the difference between Options API and Setings API? I have a theme with over 100 admin options, how should I register & store them? At this moment I'm using ...
0
votes
2answers
545 views

How Can I add Fields in wp-option table?

I want to activate my plugin and I want to create fields in "wp_option" table. How can I do that?
1
vote
1answer
597 views

How can I add an options page for my class based plugin?

I'm trying to use the new Settings API with a class based plugin to add a settings page. This is the code I have so far: class simple_sample_plugin{ function simple_sample_plugin() { ...
2
votes
2answers
2k views

How should I use register_setting, add_settings_section, & add_settings_field in my plugin's options page?

I'm working on a settings section for my plugin, and after reading over Wordpress's documentation which is in ROGUH DRAFT status, and also the Creating Options Pages - which is also in "transition", ...
4
votes
3answers
218 views

Fallback when Transient API fails

I'm trying to figure out how to best solve an issue I have with 3rd party API's (OG, Foursquare, Yelp, etc.). I use the transient API to call and store the various data in order to: Not exceed any ...
0
votes
1answer
325 views

Options don't save, validation callback not executed

I have been using settings API for my plugins for some time and it used to work well. Now it is broken and I can not figure out why. Apparently, the option validation function is not even called. Form ...
4
votes
1answer
1k views

Confirmation before deleting plugin options via uninstall.php

I'm creating a WordPress plugin and have the uninstall.php file ready. It deletes the options used by the plugin on deletion. What I'd like to do is to popup a dialog box asking whether to delete or ...
0
votes
1answer
153 views

Theme Options Menu Item - Permission Issue

I am trying to create a theme options menu item for my custom theme. However, when I add the following piece of code in the functions.php file... add_menu_page('Page title', 'Asteria', ...