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
6
votes
5answers
558 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 ...
6
votes
2answers
2k 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
1answer
582 views
Is there any plugin development framework
Since I am new to wordpress plugin development I have been examining internal structure of many plugin's and I could find most of them doesnt fit any pattern and understanding how they works is pretty ...
6
votes
3answers
301 views
Where do I put the code snippets I found here or somewhere else on the web?
Many posts here or somewhere else contain code, but they do not say where to put it.
Example:
I have found this post: How do I turn off 301 redirecting posts (not canonical)?
I'm a newbie with PHP. ...
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
191 views
How to create an API for my plugin?
I have been developing plugins for WordPress. Most plugins I have developed with two three classes and not so huge like Buddypress, WooCommerce or etc.
I am planning to make two open source plugins ...
6
votes
2answers
449 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 ...
6
votes
1answer
614 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.
6
votes
2answers
659 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() {
...
6
votes
2answers
962 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
1answer
68 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
4answers
105 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
2answers
1k views
Update widget form after drag-and-drop (WP save bug)
I've posted a bug-report about this a few months ago (on WordPress trac (Widget Instance Form Update Bug)) and I thought I'd try writing about it here too. Maybe someone has a better solution to this ...
6
votes
1answer
537 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
3answers
411 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
2answers
769 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
2answers
432 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 ...
5
votes
5answers
895 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
3answers
2k views
Creating a default Custom Post Template that a Theme can override
I'm in the midst of building a Wordpress Plugin that adds a custom post type, for which I'd like to include a default template to display. Essentially, this is an event management plugin, and the ...
5
votes
2answers
308 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: ...
5
votes
4answers
2k 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?
5
votes
1answer
292 views
How does Wordpress handle MySQL row lock errors?
If there is a WordPress plugin which updates rows in a custom table, but that update encounters a row lock, what happens? E.g. two users simultaneously fire an update on TABLE1, one setting AGE=1 and ...
5
votes
3answers
362 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 ...
5
votes
2answers
261 views
How would I create a plugin for my shortcodes?
All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my ...
5
votes
2answers
277 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 ...
5
votes
2answers
111 views
What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
I'm working on a new plugin but it's my first to save which will save an option to the database.
Currently I'm using add_option and I assumed that
- activation would fail or
- the wrong value would ...
5
votes
3answers
583 views
How to create a Wordpress plugin for another wordpress plugin?
I always do changes on the Wordpress plugins for clients. But these changes are always in danger to be lost if the plugin is updated.
Is there is a way to make a plugin for another plugin in ...
5
votes
2answers
208 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 ...
5
votes
3answers
101 views
Prevent network activation of plugin
I have a plugin that currently doesn't support network activation. The best fix for this of course is to fix it :) which I plan to do. However I wonder if there is a temporary solution I can use to ...
5
votes
2answers
2k 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 ...
5
votes
3answers
773 views
Changing Plugin Load Order
I'm writing a plugin, bar, which is dependent on another plugin, foo, being activated, and I need the functions from foo to be available when bar loads. Normally plugins are loaded in alphabetical ...
5
votes
1answer
3k views
Quick edit screen customization
Possible Duplicate: How to show custom meta box on "Quick Edit" screen?
I'm trying to edit the quick edit screen on my custom post type "visitor" so that I can add some options for my end-users. My ...
5
votes
2answers
220 views
Best practice for including plugins as part of a theme?
I'm working on a theme that includes some functionality I've developed as separate plugins (as I'm hoping to release them independently).
I'd like to include these plugins as part of the theme core ...
5
votes
2answers
93 views
Strategies to implement selective loading of plugins
I'm trying to figure out some kind of mechanism to load plugins on demand, depending on the page url, to improve performance.
My primary concern is that I have some admin-ajax.php calls that are ...
5
votes
1answer
91 views
What is the etiquette on extending a plug-in
I recently played with a plugin which I liked a lot, but felt it was missing something. So as first stage I went and wrote a tiny plugin (my first), that just added the needed feature - meaning, that ...
5
votes
1answer
539 views
How to provide translations for a WordPress TinyMCE plugin?
I know that I can get my translations into JavaScript doing:
$MyTranslations = array(
'translation1' => __("Some String 1", "MyTranslations"),
'translation2' => __("Some ...
5
votes
1answer
73 views
Listen to Post action
I am writing a plugin that adds a custom metabox to the post page. I would like to trigger an event when the user navigates away from the edit post page or when a user stops editing a specific post. ...
5
votes
3answers
179 views
Releasing new plugin version, how to rename old options keys?
I have everything ready for publishing a new version of my plugin but one last issue stands...
The old version had no naming convention for its key option names.
The options grew and I renamed all ...
5
votes
1answer
2k 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 ...
5
votes
1answer
67 views
Add screen options to Plugin pages
I want to add screen options to my Plugin 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 only two ...
5
votes
1answer
288 views
Wordpress URL Rewrite not working
I'm trying to create a custom url rewrite for my wordpress plugin.
function insert_plugin_rewrite_rule($rules) {
global $wp, $wp_rewrite;
$wp->add_query_var('update_slug');
$ret = ...
5
votes
1answer
100 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 ...
5
votes
2answers
943 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 ...
5
votes
2answers
1k views
Passing arguments to a admin menu page callback?
Situation: I'm working on a plugin and I'm developing it as a class, everything worked fine until I run into this situation. I wanted to make things a bit cleaner and tried this..
class MyPlugin {
...
5
votes
3answers
754 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, ...
4
votes
2answers
2k 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 ...
4
votes
4answers
529 views
dealing with large HTML output via plugin code
I recently wrote my first WP plugin that adds a shortcode for embedding a custom jquery image gallery into posts. It's primarily just dumps a good chunk of HTML into the post, along with javascript ...
4
votes
2answers
626 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 ...
4
votes
5answers
977 views
is_plugin_active function doesn't exist
I'm using WordPress 3.0.5 and have tested with 3.1rc4. In the main PHP file of my plugin, when I try to call is_plugin_active I get Call to undefined function is_plugin_active(). I can call add_action ...
4
votes
4answers
895 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 ...