Skip to main content
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
Results tagged with
Search options not deleted user 6035

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.

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 …
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
8 votes

How to structure a plugin

It depends on the plugin. This is my basic structure for nearly every plugin: my-plugin/ inc/ Any additional plugin-specific PHP files go here lib/ Library classes, css, js, …
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) { …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar
3 votes
Accepted

On Plugin Activation, How Do I Check for Proper Transport Mechanism?

I wouldn't cause the plugin to die like that. Just check for cURL each time you need to make a call or fall back on wp_remote_(post|get) (eg. write a wrapper function that takes care of the check and …
chrisguitarguy's user avatar
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 …
chrisguitarguy's user avatar

15 30 50 per page