The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
2answers
2k views

Are all options loaded to memory on each request?

Are all options variables fetched from the database and loaded to cache on each request?
7
votes
1answer
476 views

From a security standpoint, should bloginfo() or get_bloginfo() be escaped?

I've been reviewing a lot of information about WP theme and plugin security and understand the concept that you should escape attributes and HTML values in themes and plugins. I've seen bloginfo() and ...
4
votes
2answers
105 views

get_option() vs get_theme_mod(): Why is one slower?

I've been using get_theme_mod() for some time in various projects of mine. I decided to take advantage of the Theme Customization API in WordPress v3.4 once it was available as I felt it was an ...
3
votes
1answer
904 views

get_option() filtering and getting out of recursion

get_option() provides couple of filters 'pre_option_'.$option and 'option_'.$option. However most times I tried to make use of these it usually explodes and not worth the trouble - either I need to ...
3
votes
3answers
124 views

bloginfo() vs get_option?

What's the difference between: bloginfo('name'); vs get_option('blogname'); The parameter is just an example, but I see no differences in terms displaying what I want. Are there any particular ...
3
votes
1answer
249 views

Performance with autoload and the options table

I am playing around with the autoload column of the options table. I didn't find much information about how the autoloaded values are used. I tried a print_r($GLOBALS) and saw that the autoloaded ...
3
votes
2answers
2k views

How to change option recently_edited?

WP recently_edited option can be very useful - it tracks last 5 files that you've made changes to. Only problem is - well, that's all, 5 files. What if I've been made numerous changes to Wordpress ...
2
votes
1answer
223 views

Using get_option() in JavaScript

Previously, I used the get_option() function to get an option in PHP, like this: $width = get_option('my_width'); This is inside a shortcode function. Now, I want to have an option in JavaScript. ...
2
votes
1answer
556 views

How to use get_option() without any filter?

I'm using the newest WordPress 3.3.1 and newest qTranslate 2.5.27. I have made some an AJAX script which returns a value and message in the current language. Here I get my first problem, I solve it ...
1
vote
1answer
186 views

Why does Wordpress stores widget options in a multidimensional array?

I have a widget with 6 different options. When I use get_option, it gives me a multidimensional array, with all my options inside the inner array, like so: $options = get_option('widget_widgetname'); ...
1
vote
2answers
563 views

Is get_option function cached?

In my plugin, I use the following code to retrieve an option from the database: $options = get_option('my_plugin_options'); If I use this 10 times in various functions of my plugin, does WordPress ...
1
vote
1answer
352 views

Where should I use get_option in a plugin

I am working on creating a plugin to help me with future development projects. I want to make sure what I am using best practices when I write it. My question is about the use of get_option in my ...
1
vote
1answer
294 views

Save wp_editor() content as option

I'm having some troubles with a extra feature i'm writing for my theme. The admin should be able to make some special posts, those posts are stored as an option. The options are atored as an array ...
1
vote
1answer
357 views

How to display usermeta on front end of site

Question: First example: when getting options from the database for a plugin. You'd use get_option['plugin_optios']. My question is how do you 'GET' data from another table? Like wp_usemeta. I ...
1
vote
1answer
592 views

What's the order of loading wordpress elements?

I currently try to make a theme for wordpress and I'm confused about lots of things. I'm not sure what's the order of loading wordpress elements, where some variables are available, where they are ...
1
vote
1answer
13 views

differences between behavior get_option vs get_site_option in multisite

I am converting a bunch of sites to multisite and I am confused about the behavior differences between get_option and get_site_option. It appears that get_site_option actually means ...
1
vote
1answer
892 views

WordPress Settings API, Implementing Tabs On Custom Menu Page

I've been following the WordPress Settings API tutorial series of this guy: http://wp.tutsplus.com/tutorials/theme-development/the-complete-guide-to-the-wordpress-settings-api-part-1/ So far, I've ...
1
vote
1answer
54 views

Can I force get_option to go back to the DB instead of cache?

Is there any way to guarantee that when I call get_option I will definitely get the value from the database and not from cache?
1
vote
1answer
161 views

Echoing a variable inside a function

In the interest of automation, instead of making a long list of code like this <td valign="top"width="50%"><p><label for="Facebook"><strong>Facebook ...
1
vote
3answers
401 views

Showing option when page is frontpage

Currently I'm having some difficulties with below snippet. As it currently works it shows the_excerpt_rss on a single post and single page. AND it shows the option on is_home(). But what if a page ...
1
vote
1answer
906 views

How to find out if page_for_posts is showing (in order to style menu item)

I have set a static page for posts (page id = 110). This page shold only be included in the menu when the user is logged in. The latter is achieved with the following addition to header.php (snippet ...
1
vote
1answer
3k views

How to get the true permalink of the static home page?

I asked a very similar question earlier today (http://wordpress.stackexchange.com/questions/30392/how-to-get-the-original-post-id-of-a-static-home-page) and thought I had the answer, but now it ...
1
vote
1answer
1k views

Why isn't get_option array contents displaying?

I've been to countless posts looking for the answer to this and have tried nearly every combination. So obviously, I'm missing a step so small that it's likely unfathomable to the Wordpress ...
1
vote
1answer
431 views

Access bloginfo, get_option, and plugins_url from a non-core php file

I am creating a plugin that has a php file in the plugin directory which is accessed directly via a custom rewrite url. I need this file to be able to use the three functions mentioned in the title. ...
0
votes
3answers
767 views

add action wp_head not working

I am trying to add some code to the head (namely a block of tracking script) via a plugin I am making. The plugin has an interface where the user enters some details which are then added to the ...
0
votes
3answers
981 views

How to load WordPress on non WP page?

I want to use the get_option() function of wordpress in one of my theme's files, which is not related to WP, it is just located in the same directory of the other theme files. I need this file because ...
0
votes
3answers
127 views

get_option error plugin development

Im creating a plugin with the following structure: plugins (folder) - myplugin (folder) - myplugin_index.php (adminpanel file) - myplugin_ajax.php (loading data when user enters a form on the ...
0
votes
1answer
747 views

Time & Date on Post - Time Ago Custom Function

I'm using the following custom function to display the timestamp for a post as posted "X minutes ago" or "X days ago" for 14 days and then this changes to the actual date (e.g. 17th December 2010): ...
0
votes
1answer
301 views

Minimal wordpress load for only `get_option` to work (because ajax…)

In a plugin I use ajax to get_option() which takes much longer than it has to because entire wp gets loaded. How do I set things up so that it (my ajax) loads only what is needed? (get_option())
0
votes
2answers
219 views

Pull GetOption() variable into jQuery dynamically created html

I have a page with the following markup in the site theme footer: <div id="modalpopup"><div id="inside"></div></div> I have a variable in the WP db I can retrieve via ...
0
votes
2answers
184 views

How to prevent plugins from sniffing/stealing other plugins' options?

Many plugins require configuration with sensitive data such as API keys, passwords, etc. When implementing these plugins, this sensitive data is stored using functions such as update_option() and ...
0
votes
1answer
149 views

My WP_Query didn't work after upgrading to WordPress 3.2

I created a custom loop using WP_Query for my featured content slider. <?php $slider_query = new WP_Query(); $slider_query->query("posts_per_page=5&tag=".(get_option('cgr_slider_tag'))" ...
0
votes
1answer
21 views

Using update_option() and get_option() is echoing escaped strings

I'm using the Option API for my theme settings page. I use the $_POST data to update the options when the changes are saved. My issue is that the strings I send get escaped and when I use this code: ...
0
votes
1answer
30 views

How to perform a frontend HTTP call with AJAX when plugin save the new settings?

I use a function to "pass" the data with get_num_queries from the front to the back end (to a plugin options page). function get_queries_wpse_143544() { $dbq = get_num_queries(); ...
0
votes
1answer
149 views

Fatal error: Call to undefined function get_option()

When I try to send mail... it showing - Fatal error: Call to undefined function get_option() in /home/junkie/public_html/sub_demo/wp-content/themes/scroller/includes/contact-form.php on line ...
0
votes
1answer
24 views

How do I display a WP Option from an array?

I have a problem displaying the data that I am successfully saving to my database. function create_input_twitter_option() { $options = get_option('global_options_arraykey'); ?><input ...
0
votes
1answer
243 views

why does get_option( 'home' ) not work while using in plugin [closed]

I'm working on a wordpress plugin and am running into an inssue with get_option( 'home' ). What I'm trying to do: if the user (or admin) is not logged in then a login form will appear on a custom ...
0
votes
1answer
585 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 ...
0
votes
1answer
168 views

How to access a variable on all page?

I added a variable to my functions.php file: $options = get_option( 'simple_options' ); I can access to this variable on every page, but If I call it in the footer.php it's not working. How to fix ...
0
votes
1answer
50 views

How do i know which action / filters are called when i call get_option()

I need to know which action / filters are called when i do a get_option() call, how can i do that?
0
votes
2answers
301 views

If option: show this. Else show nothing

First, I have to admit I'm not entirely sure on how to explain this best. Currently I have this in my header.php: <?php if ( is_home() OR is_front_page() ): ?> <meta name="description" ...
0
votes
1answer
34 views

Echo option page form field value

Here is my option page code containing a no of fields like logo, slider after filling all the information in option page form. I need two things After submitting all the form details save ...
0
votes
1answer
63 views

Ajax - Call to undefined function get_option()

So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left ...
0
votes
1answer
53 views

Saving an array to get_options

I'm trying to save an array to get_options in wordpress, I'm aware that I don't have to serialize the array due to get_options doing that. At the moment I don't get any success of failed message upon ...
0
votes
1answer
35 views

Thumbnail of the latest posts page

I have a page "Blog" and it's set to display latest posts. This page itself has a thumbnail, and I want it to be displayed in header. Every other page/post has same layout and thumbnail shows in ...
0
votes
1answer
101 views

get unserialized array without using get_option()

I'm working on a WPMU plugin that cycles through tables in each blog on the network. I can't use get_option to pull the settings array out of the wp_n_options tables, so I'm trying to do it by ...
0
votes
1answer
232 views

Multiple entries in get_option results? or why is _multiwidget set to 1?

I am developing a wordpress widget, and need to store some user configuration values, that is why I am using wordpress update_option and get_option. I am new to widget development. I have some ...
0
votes
1answer
35 views

the correct way to use options from settings page [closed]

I'm creating a plugin in Wordpress and am a little confused how I should use settings I set in my settings page. I used: http://codex.wordpress.org/Creating_Options_Pages to create my settings page. ...
0
votes
0answers
14 views

how to saved the values ​​of selected checkboxes in an array [duplicate]

<?php function register_mysettings() { register_setting( 'cr-settings-group', 'post_type' ); } function cr_settings_page() { ?> <div class="wrap"> <h2>Your Plugin ...
0
votes
0answers
280 views

Echo the key from a select-box in Array with get_option (Settings API)

I'm trying to print a key from one select box. I'm using the WordPress Settings API. This is the array: $options = array ( array( "name" => "Styles & Fonts", "type" => "title"), ...