Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
In WP `options` is the term used for variables stored in the database. They are accessed through the options API.
37
votes
Accepted
How does object caching work?
The summary:
A page starts
All options are loaded with a simple SELECT option_name, option_value from $wpdb->options statement
Subsequent requests for those options (eg a call to get_option never hit … Which brings up the question of when to use options vs. transients.
Simple. If you need data to persist indefinitely, use options. …
24
votes
Accepted
Are all options loaded to memory on each request?
When the get_option call is made, WordPress runs a function called wp_load_alloptions, which either grabs a cached copy of all autoloaded options or loads all those options into the cache. … Then wp_load_alloptions returns an array of all the autoloaded options. …
17
votes
Accepted
From a security standpoint, should bloginfo() or get_bloginfo() be escaped?
We have to look a bit deeper here to get an answer to your question.
So, bloginfo is a simple wrapper around get_bloginfo.
<?php
function bloginfo( $show='' ) {
echo get_bloginfo( $show, 'displa …
6
votes
Accepted
Testing for addon plugin activated
There is the function is_plugin_active() which can be used easily for this check, but what if the user decides to change the folder name of the plugin?
Simply put, you're doing it wrong.
If you' …
5
votes
Accepted
Minimal WordPress load for only `get_option` to work (because ajax...)
If you're building something for public consumption (a plugin, a theme, etc) use admin-ajax.php like you should because that is the appropriate and accepted way to do things and gives your end users t …
3
votes
Save user-specific options in WordPress admin
And it probably won't work with "subscriber" level users or those who can't manage options.
But if it's one or two options, the easiest thing to do would be to add fields to the user profile page. … // then save
if( isset( $_POST['_your_fields_name'] ) )
update_user_meta( $user_id, 'wpse27690_user_key', esc_attr( $_POST['_your_fields_name'] ) );
}
When you save individual user options …
2
votes
1
answer
324
views
Restore a Plugin's Default Settings
Is there a way to code "Restore Defaults" button into a plugin options page? …
2
votes
Saving widget options from class method
php
class WPSE76224_Widget extends WP_Widget
{
public function __construct()
{
// Create the widget options and such here, then call
// $this->WP_Widget to let wordpress know about …
1
vote
Creating on-page options for Custom Post Type
What you want is a custom meta box.
Searching this site will give you plenty of examples as well, but here's a brief run down.
You hook into add_meta_boxes and call, appropriately, add_meta_box.
<? …
0
votes
Accepted
Restore a Plugin's Default Settings
Nevermind, answered my own question:
http://www.keyframesandcode.com/resources/javascript/jQuery/demos/populate-demo.html
Used that to update all the text and drop downs. Couldn't get it to work wit …