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 |
WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins.
0
votes
Accepted
How to exit a plugin's execution mid-stream?
A possible solution would be to hook in way late (template redirect, for example), do your conditional check. If it passes, include (or require) a file that contains the stuff needed.
<?php
add_acti …
3
votes
Declare plugin dependency
It's not possible in the core. There are a few ways to approach this.
1. Hook into plugins_loaded check to see if X from your dependency plugin exists.
add_action('plugins_loaded', 'wpse120377_load …
3
votes
Save user-specific options in WordPress admin
When you register your setting (assuming you're using the settings API), you can get the current user object with wp_get_current_user. It returns a user object, and the property you'll want to use in …
6
votes
Accepted
Changing bloginfo description from a plugin
You're lookign for the bloginfo filter.
<?php
add_filter( 'bloginfo', 'wpse33522_change_bloginfo', 10, 2 );
function wpse33522_change_bloginfo( $text, $show )
{
if ('description' == $show) {
…
6
votes
OOP Plugin and Menu - Call to undefined function register_setting()
They are undefined because the functions don't exist right when plugins (or themes) are loaded -- the admin area includes have not happened yet.
If you want to register settings fields it's best to h …
10
votes
Accepted
Are shortcodes case-sensitive?
Short Answer
Yes, shortcodes are case sensitive
Longer Answer
It's really easy to build a test case for this and see.
<?php
add_shortcode('sOme_ShOrTcOdE', 'wpse102375_shortcode');
function wpse10 …
12
votes
1
answer
2k
views
Giving Multiple Authors Access to a Plugin's WP.org Repo
A plugin I've released has a collaborator. So I put them into the readme.txt file and they show up on the plugin page and all that.
Does doing this automagically give them access to the SVN reposito …
17
votes
4
answers
12k
views
Should Plugin Folders Include a Blank index.php File?
WordPress itself, in the wp-content folder, includes an empty PHP file which looks like this.
<?php
// Silence is golden.
?>
Should plugins include an empty file like this as well to stop folks vie …
83
votes
3
answers
29k
views
Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
Has anyone used autoloading and/or PHP namespaces within a plugin or theme?
Thoughts on using them? Any harm? Pitfalls?
Note: namespaces are PHP 5.3+ only. Assume, for this question, that you know y …
100
votes
Accepted
Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
Okay, I've had two big projects where I've been in control of the server enough to namespace and rely on autoloading.
First up. Autoloading is awesome. Not worrying about requires is a relatively go …
11
votes
Accepted
Using require_once in a Plugin?
The first one is like saying...
Include the file found in the inc directory, above the directory
where this file is located.
The second statement is saying...
in the server root (/) look i …
28
votes
Accepted
Add multiple plugin directories
Okay, I'll take a stab at this. Some limitations I encountered along the way:
There are not a lot of filters in subclasses of WP_List_Table, at
least no where we need them to be.
Due to that lack of …
2
votes
Accepted
Where to store the name of a custom table?
As long as...
You use $wpdb->prefix (or $wpdb->base_prefix) to prefix the table
Your table name is someplace public, and easily available for other plugins, themes and end users to use and extend
…
9
votes
Accepted
Custom Post Type Plugin: Where Do I Put The Template?
So what's the best practice here?
I would say a combination of letting the theme handle it and providing a default with your plugin.
You can use the single_template filter to switch out the temp …
5
votes
Accepted
Where to put third party PHP library?
If each plugin/theme functions on its own, then you should probably drop the the library in every theme/plugin.
Then just check to see if it a class or function from the third-party library exists be …