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
3k 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
304 views

Is There a Plugin Life Cycle Documentation?

Is there some documentation somewhere that explains what is the life cycle of the plugins? I'm starting a new plugin with OOP style, and I just found out that my main class is being instanciated a ...
8
votes
5answers
5k views

Including jQuery and JavaScript files the correct way

I'm having some trouble with this. I'm not sure how to do it the correct way, and I read so many different techniques and ways to do it that I don't know what to make of it. Some questions and ...
8
votes
2answers
1k 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
1answer
3k 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
5k 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 ...
7
votes
5answers
974 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
987 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
3answers
559 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 ...
7
votes
2answers
1k 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
1k 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
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
245 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
1answer
843 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
192 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
2answers
3k 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 ( ...
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
3answers
1k 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 ...
6
votes
6answers
3k 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
346 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
2answers
5k 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
4k 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
3answers
785 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
1k 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
2answers
529 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
2answers
683 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 ...
6
votes
2answers
252 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
1answer
162 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
96 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
576 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
123 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
130 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 ...
6
votes
3answers
846 views

Replace audio/video enclosure with player?

Current state: I'm parsing XML feeds into the front end and/or the back end (Admin UI), but not into the DB. Inside those feeds i place mp3- and video content, currently only as plain text (no link, ...
6
votes
1answer
694 views

Mini-Site Strategy

I'm working on a project to allow a number of mini-sites within a WordPress multisite installation. Here's how it's supposed to function: The client has a large number of individual locations, each ...
5
votes
2answers
4k views

How to change a user's password programatically

I am trying to create a totally different profile page (not the one provided by Wordpress), since the layout and feel of the default profile page is too "Wordpress" for the users. Now I am successful ...
5
votes
3answers
587 views

How do I log plugin (cron) actions?

Is there a recommended way to log (failed) cron actions from your plugin? For example, I have a plugin that synchronizes with an external service every hour. I want to log how much was changed, but ...
5
votes
3answers
505 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?
5
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 ...
5
votes
2answers
871 views

Test to see if jQuery or Prototype is queued by another plugin?

In my plugin, I want to test to see if jQuery or Prototype (or both) are going to be loaded by another plugin. So, have wp_enqueue_script('jquery') or wp_enqueue_script('prototype') has already been ...
5
votes
4answers
1k views

How to create and link to administration page for a plugin?

OK Full Code: <?php //check to see whether the user is an admin or not. if (is_admin()) { function wpsc_display_products_seo(){ global $wpdb; $productList = $wpdb->get_results("SELECT * FROM ...
5
votes
4answers
5k views

What is the wordpress wp-includes folder for?

What is the wordpress wp-includes folder for? That is, whats the fundamental architectural purpose of it, for example why isn't it all in themes or an admin folder? Can a plugin developer rely in ...
5
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 ...
5
votes
2answers
169 views

How to redirect to settings page once the plugin is activated?

I created the Plugin of my own. Everything seems OK but one thing I want to do in that plugin is redirect to the corresponding plugin settings page when the plugin is activate. For example: ...
5
votes
2answers
2k views

How to implement bulk actions in my plugin?

I am developing a WordPress plugin. This plugin displays a list of courses. Now I want to implement the bulk actions just like in other plugins. From where I can apply the delete and edit actions to ...
5
votes
4answers
4k views

What is difference between get_bloginfo('url') and get_site_url()?

I am developing a plugin. I want to know difference between get_bloginfo('url'); and get_site_url(); I got same output, then what's the difference?