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.

learn more… | top users | synonyms (1)

9
votes
1answer
162 views

Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?

I'm wondering how the number of downloads displayed in the plugin-directory correlates to the number of actual websites using the plug-in. I realise some people will download and never install and ...
9
votes
5answers
2k views

How can I add an option to the Page Template list from a Plugin?

I've been looking around for the past couple hours for a way to create a custom page template from within a plugin but haven't had any luck yet. What I am specifically trying to do is add an option ...
9
votes
1answer
4k views

Plugin Form Submission Best Practice

I have done a lot of researching and haven't found quite what I am looking for, so I am hoping that I can be pointed in the right direction. I am developing an Events plugin that will book a ticket ...
9
votes
2answers
2k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
8
votes
2answers
7k views

How do i best handle custom plugin page actions?

I'm constantly running into the same annoyance, so i thought i'd see if there's any ideas or experience out there... I've created a plugin that uses it's own admin page. It has to. Now that i sorted ...
8
votes
3answers
2k 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 ...
8
votes
3answers
594 views

What are the advantages to the Settings API?

Let me preface this by saying that I hardly ever work with WordPress - in fact, the last time I did a site in WordPress was back during 2.2. Yesterday I made quite a mess of everything and asked ...
8
votes
2answers
2k views

Why activate_plugin is not working in register_activation_hook

I am trying to activate second plugin automatically while activating first plugin. register_activation_hook(__FILE__, 'example_activation' ); function example_activation() { ...
8
votes
2answers
3k views

How to Remove Certain Screen Options and Meta Boxes from add/edit post type?

Now, when you add or edit a particular post within your desired post type, there are more screen options as well. Although, these Screen Options are showing/hiding meta boxes. I would like to be able ...
8
votes
1answer
4k views

How are bulk actions handled in custom list table classes?

I'm working on a custom data table to display in the WordPress dashboard. The table populates from a database table I built in a plugin. I've been using the provided WordPress Custom List Table ...
8
votes
4answers
2k views

How to debug a plugin with Xdebug?

I was able to install and setup quite easily NetBeans 6.9.1 and Xdebug on my local environment, based on PHP 5.3.0 (XAMPP). My problem now is the following: if I put a breakpoint on Wordpress's ...
7
votes
3answers
1k views

Is the new WordPress 3.1 admin bar pluggable and how can I extend it?

How can I extend the functions of the WordPress 3.1 admin bar in my plugins? I am looking for specific hooks and filters to use in adding links or other features to the admin bar. A good example ...
7
votes
2answers
1k views

Settings API updated messages won't show if custom admin page not hooked into add_options_page()

Been playing around with the Settings API and found that messages (for success or errors) are only displayed when a settings page is hooked into WordPress menu via add_options_page(). Anything else ...
7
votes
2answers
4k views

List all sidebar names?

I'm listing all sidebars like that: global $wp_registered_sidebars; echo '<pre>'; print_r($wp_registered_sidebars); echo '</pre>' So I'm getting something like: Array ( ...
7
votes
5answers
1k views

How can I update a wordpress plugin from a Git repository (github)

is there any way to easily update a plugin installed on multiple sites from a github repo. I know I can do it from the command line of each server using git pull. but is there a way to do it from the ...
7
votes
2answers
1k views

How to fork a plugin?

I want to start giving back to the community, but writing a plugin from scratch is currently slightly beyond my skill level and creativity level (meaning, I don't know what kind of problem I can solve ...
7
votes
2answers
1k views

wp.media update options and force render on uploader

Elliot here from the "Advanced Custom Fields" plugin. I'm working on integrating the new WP 3.5 uploader into the ACF plugin and can't find much documentation about the new uploader at all! Creating ...
7
votes
2answers
2k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: ...
7
votes
1answer
2k views

What is the advantage of using wp_mail?

What is the advantage of using wp_mail() over mail(). Codex says they're similar, but they seem to be very similar.
7
votes
1answer
3k views

Making my plugin multi-site compatible

I want my plugin to be installed on each blog and create database tables per blog. I have this code: register_activation_hook( __FILE__, 'install1' ); function install1() { global $wpdb; if ...
7
votes
2answers
875 views

Is wp-content/install.php a Drop-in?

I cannot find documentation or discussions on what is and how to use Drop-in plugins. The question was raised in this Q&A, Populate content on install. Is a wp-content/install.php file that ...
7
votes
2answers
3k views

Creating a Custom Post Type as a Plugin? Why?

I've been experimenting with creating a Custom Post Type as a plugin (because I've seen this recommended in various places). But I have a question not about the how, but rather the why of building ...
7
votes
3answers
262 views

Getting a peer review for my new plugin?

What is the best way to get an experienced WordPress developer take a look at my plugin and give constructive criticisms? I have written code to solve some of my questions on this site, and I think ...
7
votes
2answers
2k views

How to store username and password to API in wordpress option DB?

I'm currently developing a plugin and the chances are that I will more than likely release it on the public plugin repository so others can use it. The plugin will be using an API and to use this API ...
7
votes
1answer
1k views

Add screen options to custom admin pages

I want to add screen options to my plugin settings page, like the ones that are available in the Dashboard. I tried using the add_option method of the WP_Screen object and found that it supports ...
6
votes
17answers
403 views

The Great Plugin Nomenclature Contest of 2011

It's been a while since I've done a bounty challenge, so here's another. Same basic rules: 1 answer per person, most creative/useful/helpful/entertaining answer wins. This time around, the award will ...
6
votes
5answers
208 views

What is the importance of writing a < WP 3.x compatible plugin nowadays?

I am currently writing a simple-ish plugin with custom posts and a couple functions, using post metadata and adding a couple of variables to the "options" table in the database. During my research, I ...
6
votes
3answers
724 views

Best way to abort plugin in case of insufficient PHP version?

You write a plugin which requires PHP 5.1. Someone tries to install it on a server with PHP 4. How do you deal with that in a safe and user-friendly manner?
6
votes
2answers
2k views

On the WordPress Admin section how do I link to submenu pages created for a plugin?

So i'm trying to create a WordPress plugin and I've created some menu pages using this provided function: add_submenu_page('my_plugin_menu', 'Edit record page', 'Edit record page', 'manage_options', ...
6
votes
6answers
4k views

WordPress Plug-in Development In MVC Architecture, How?

I think, the wordpress plug-in architecture is not MVC. So I want to use/do the MVC architecture in WordPress plug-in development (like cakephp, codeIgniter ). How can I use them in plguin ...
6
votes
1answer
429 views

How to create a flexible abstraction for WP_Query?

My question is about php but it involves wordpress as i am creating a plugin. The case is that i have 5 questions, each question have 6 choices and one choice to choose from each. Now the person would ...
6
votes
6answers
2k views

Where to store PHP files created by plugin / themes

There are cases in which a plugin or theme needs to create a php file somewhere that can later include it. For example a captcha plugin, or some kind of a templating system like twig/smarty (In my ...
6
votes
1answer
2k views

How to override existing plugin action with new action

I'm using a plugin. It has an action like this. add_action('publish_post', 'old_action'); function old_action($pid) { "code goes here" } } I'm writing a module for this plugin. So i need to ...
6
votes
10answers
6k views

Wordpress Plugin Development - Headers Already Sent Message

I'm developing Wordpress plugins. When i activate my plugin, i'm getting a message The plugin generated 293 characters of unexpected output during activation. If you notice “headers already ...
6
votes
2answers
2k views

Default table collation on plugin activation?

I'm following this to make my plugin auto-create a table when the plugin is activated, but what happens is that while all the tables (the whole db) are utf8_general_ci, the newly created table is ...
6
votes
3answers
5k views

Getting Path To Uploaded Attachment Image After Upload

After you have uploaded an attachment in Wordpress using the media upload screen, is there a hook or filter I can run after the image has been uploaded where I can get the path to the uploaded image ...
6
votes
2answers
8k views

How do I create a custom role capability?

I wish to create a custom capability for accessing the interface of my plugin. Should the plugin manage adding this capability to all the administrator accounts on activation? If so: Does WordPress ...
6
votes
3answers
1k views

How would you require and automatically download dependent plugins?

Was wondering if there was a class or programming technique that would allow me to check for the installation and activation of a particular plugin and if said plugin were not installed, to have it ...
6
votes
2answers
714 views

What is the correct way to build a widget using OOP

I am working on a simple search form widget, with a built in autocomplete capability (You can download the current version here). The plugin is working, but I am currently rewriting all the code using ...
6
votes
1answer
267 views

Optimize shortcode callbacks

I created a plugin to add some shortcodes in my WordPress site. But I'm a PHP newbie, so I believe it may have some errors or ways to optimize it. It's working fine, and apparently there are no ...
6
votes
1answer
6k views

Should I use wpdb prepare?

I'm new to SQL and am wondering if I need to use wpdb->prepare for the following query to a table I've created global $wpdb; $tablename = $wpdb->prefix . "my_custom_table"; $sql = "SELECT * ...
6
votes
1answer
3k views

whats the difference between term_id and term_taxonomy_id

the title says it all. At the moment in my custom taxonomies I'm getting the terms using the term id and taxonomy name. Thought this question would've been asked before but can't find it anywhere! So ...
6
votes
2answers
332 views

How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?

I've been playing around with code snippets which add meta data to admin searches. The best snippet I've found was written by Stefano on this question. However, it appears to have 1, annoying bug ...
6
votes
3answers
1k views

How should one implement add_settings_error on custom menu pages?

The Professional WordPress Plugin Development book explains in detail how to properly use the Settings API, and it also demonstrates how to add Menus and Submenus, but unfortunately it doesn't provide ...
6
votes
1answer
956 views

Change admin language based on user (in single-site)

I'm trying to make a small plugin to install in some sites of a german client. I can make my way around WordPress in german, but would be easier if it was in english. There's a plugin that manages ...
6
votes
1answer
178 views

How to write testable classes in Wordpress

I'm currently doing some modifications on the Wordpress plugin that I created in order to make it testable. The problem is I don't know which methods am I suppose to write tests for. I have methods ...
6
votes
1answer
107 views

API to trigger prompt on leaving page

I have a proprietary plugin that creates a metabox on the edit-post page. When the data managed by the plugin is edited and the user navigates away then we would like the user to be prompted as ...
6
votes
1answer
635 views

What is the difference between esc_html and wp_filter_nohtml_kses?

What is the exact difference between esc_html and wp_filter_nohtml_kses. Everywhere I look says that both strip all the html, the only difference I can see is to do with exactly how they do this. Does ...
6
votes
1answer
128 views

Rewriting every url

I have a question regarding permalinks and rewriting url's. I am writing a translation plugin and I would like to add the language shortcode in my url (Something like ...
6
votes
4answers
151 views

Is it necessary to bump a plug-in's version if you're just updating the “Tested up to” attribute?

I've got a number of plug-in's hosted on the wordpress.org svn server ... with the immenent release of 3.1, I would like to update the "Tested up to" meta data. There will be no functional changes to ...