Plugins are tools to extend the functionality of WordPress. This tag should not be used to mark requests for plugin recommendations, which are off-topic per the FAQ.

learn more… | top users | synonyms (2)

9
votes
1answer
1k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do ...
9
votes
1answer
129 views

How MUST the directory for a plugin be structured?

I get the basic plugin concept. I've read the Codex article on Writing a Plugin That article talks about the "main plugin file". How does Wordpress determine "the main plugin file" ? Q1: Is it ...
9
votes
1answer
129 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
2answers
1k views

How to add field for new site-wide option on Network Settings screen?

I'm working on a plugin, and part of it involves setting an option value that applies to all sites in a WordPress network. I know about the add_site_option and get_site_option functions that let you ...
8
votes
3answers
10k views

How do I show data from gravity forms in my template?

Preface I've installed gravity forms, created a form and users are submitting data to my site. What I want to do is show the data users are submitting to my site on one of my pages. I know there's ...
8
votes
3answers
8k views

How To Activate Plugins via Code?

If possible, how can installed plugins (meaning the files have been placed in wp-content/plugins directory) be activated from other plugins?
8
votes
2answers
7k views

Woocommerce - Add a product to cart programmatically via JS or PHP [closed]

I am using the Woocommerce plugin to facilitate a small e-commerce part of a site and need to add products to it's cart via some call or function rather than using it's own 'add-to-cart' buttons. By ...
8
votes
4answers
1k views

Is there a WordPress plugin that registers a plugin file as a custom page template?

I need to create a plugin that makes custom page templates available in wp-admin. I'm wondering if someone has tackled this already, as it seems like a pretty typical process?
8
votes
2answers
150 views

How do I exclude plugins from getting automatically updated?

There is an opt-in filter that allows all plugins on my site to receive automatic updates: add_filter( 'auto_update_plugin', '__return_true' ); I like this feature, but I don't want all my plugins ...
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
6answers
305 views

What plugins do you commonly install on a fresh WordPress install?

I'm looking at finding out what plugins others install most of the time on a fresh WordPress install; the plugins that add value to pretty much any website that is running WordPress. My list of ...
8
votes
2answers
346 views

How to get a variable number of posts per post type on the main loop?

I'm looking for a way to balance the content at the homepage of my blog: the blog has a few post types like Poscasts, Videos and Blog and I'd like to have let's say 10 Posts on the homepage, but I'd ...
7
votes
6answers
778 views

What are the best practices for updating?

Don't want to do anything to take down my blog. Here are some upgrade-related questions: How often should Wordpress be updated? What is the best way to do it? How to know if there is a problem with ...
7
votes
3answers
2k views

Are there any hooks that alter the 404 logic?

Provided you have a 404 page defined in your theme, Wordpress will display a 404 page if "tag" is defined in $wp_query->query_vars, and there are no posts matching that tag. I'm writing a plugin that ...
7
votes
5answers
14k views

How to detect WP plugins used on a site

Is it at all possible to detect the list of plugins used on a WP site. Also, beyond my initial hunch, how can confirm for fact that a blog is indeed powered by WP?
7
votes
1answer
3k views

Disable update notification for individual plugins

Is there a way to disable update notifications for specific plugins? As a plugin developer, I have some plugins installed on my personal site using the svn trunk version for testing, but the same ...
7
votes
4answers
1k views

How can I delete orphan keys in WordPress database tables?

In particular in table wp_options. After almost 2 years of blog production it seems increased a lot, and I don't know how many crap is in there. Do you know a plugin that works with WordPress 3.0 or ...
7
votes
2answers
986 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
466 views

Plugin Development: WPMU or WP?

I was thinking, what kind of issues might I face if I port a plugin from WPMU to WP or vice versa. Say I developed a plugin from scratch and wanted that plugin to be compatible with both, should I ...
7
votes
4answers
1k views

Security and .htaccess

About a month ago I started a WordPress blog on a hosted server related to a hobby. So, I am new to this at present. Since I'm concerned about security, one thing I did was to install the plugin WP ...
7
votes
2answers
132 views

How to customize a plugin whilst maintaining ability to upgrade

I am currently working on a major update to one of my WordPress plugins. The plugin lets the user choose from several available skins. Quite often I get asked to create a custom skin. To prevent this ...
7
votes
1answer
1k views

Custom Post Type Templates from Plugin Folder?

I'd like to offer my custom post type as a Plugin, so that people can use it without touching their theme folder. But custom post type templates -- such as single-movies.php -- reside in the theme ...
7
votes
1answer
62 views

Wordpress plugin archive

I need to find an archive of some Wordpress plugins. Previous webmaster of the site installed some plugins and then made modifications to some of them. He did not document these modifications in any ...
7
votes
1answer
140 views

Shared functionality in plugins and themes

I recently started to develop plugins and themes and I found that I need to use several functions of on both. Sometime I think about to check if function / class exist before declared as said on this ...
7
votes
5answers
1k views

Syntax highlighting for post/page editor [closed]

Anyone know of a plugin that adds syntax highlighting to the post/page HTML editor? Thanks-
7
votes
1answer
446 views

Experiences with adding Nonces to the comment form

I was wondering about the impact nonces would have on the default comment form a theme has. Because Nonces are a built-in feature of WordPress I thought about giving it a try. Does somebody has ...
7
votes
3answers
743 views

Help with 4.6. Attachment response object in JSON API plugin

I am a big fan of the JSON API plugin. The developer did a great job and I thank him very much. I am learning how to work with json and jquery and am trying to limit the information I get back from ...
7
votes
3answers
1k views

How can I create a bash install script for my Wordpress sites setup (WP+plugins+theme)?

I build a lot of websites with Wordpress, and my initial setup is basically always the same : Latest version of WP Latest versions of about 5 plugins My naked development theme Instead of ...
7
votes
3answers
2k views

How can I allow commas in tag names?

I want to allow commas in tag names? For example, "hello, world" or "portland, or" but Wordpress keeps separating them. I can do it from the categories page: And it shows up fine. But anything ...
7
votes
2answers
269 views

Plugin for editing options on multisite?

does anyone know of a plugin for mass editing of settings on a multisite installation? Something like Plugin Commander for Settings?
6
votes
2answers
18k views

How to customise the output of the WP image gallery shortcode from a plugin?

We're building a plugin that displays posts, and we also want to display the image gallery when it is used in a post. However, we need to limit the number of photos displayed? Is that possible?
6
votes
2answers
161 views

Can I leave off plugin textdomain for terms used in core?

I've got a plugin that puts post statuses into post type admin menus. I'm in the middle of internationalizing it, and I'm wondering how to handle this situation. The plugin uses some unique strings ...
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
5answers
5k views

How to translate a plugin via .po .mo?

I want to translate this plugin. This plugin already has translations to some languages, and it has .pot file for adding new languages (as far as I understood from description). Although I never had ...
6
votes
3answers
525 views

How to add “Stick this post to the front page” to front end?

I have a baseball related website with multiple authors. I use the "Stick this post to the front page" to denote an "Editor's Pick" on an article. I would like to add a link/button to allow editor to ...
6
votes
4answers
2k views

Turn Off Auto Update for Single Plugin

I have a plugin that I know I never want to update. I am aware that this is NOT best practice, but in this case it must be done. Is there any way to stop WordPress from prompting me to auto-update a ...
6
votes
3answers
4k views

How to catch/what to do with a WP Error Object

I am running some of the WP functions directly inside a plugin, including wp_insert_post(), if something goes wrong, this returns a WP Error object, what is the correct method to catch this error? ...
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
4answers
267 views

How do you allow plugins to be updated using the GUI without breaking your subversion repository?

Development on a WordPress installation is under Subversion version control. We're not using externals to link in the plugins - the plugins are getting installed / updated by non-developers in charge ...
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
2answers
120 views

What is right way to go about adding functionality to a published WordPress plugin?

So I looked all over to try and find some kind of rules, or at least some common-courtesy guidelines, concerning this issue and couldn't find anything. Essentially I'm wondering what I should do when ...
6
votes
2answers
426 views

How to prevent a post from being deleted?

For auditing issue, I only want a post can be trashed, but not deleted - for all users. So I have a plugin like add_action('before_delete_post', function($id) { wp_die(0); }); But ...
6
votes
3answers
784 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
6answers
441 views

Is it heavyweight plugins or lots of plugins that make a site slow?

I've often heard that having a lot of plugins will slow down a WordPress site. This makes sense of course, as the more code that executes, the longer it will take. I'm wondering whether the slowness ...
6
votes
4answers
4k views

Enabling free shipping on Woo Commerce by specific items

I would like to know if it is possible to enable free shipping with Woo Commerce only if certain items (or items of certain categories / shipping classes) are included in the cart. The Free Shipping ...
6
votes
2answers
437 views

Is there a plugin that will override the “Error establishing a database connection” message?

My provider's database server recently had some downtime and my site was displaying the classic "Error establishing a database connection" message for about an hour. I knew what the problem was but ...
6
votes
1answer
1k views

What plugin can I use to create a list / slideshow of featured images?

I'm looking for a plugin that will allow the user to upload files, maybe 4-10 that can be used on the homepage as part of a slideshow. I can code the slideshow part myself, if necessary, but the thing ...
6
votes
1answer
199 views

Is there any sort of theme dependency management?

I'm developing a Wordpress theme with a few other individuals and am running into a problem where I add a plugin and then I have tell the other developers about the plugin I installed and the settings ...
6
votes
1answer
2k views

Restricting a Plugin to Only Load its CSS and JS on Selected Pages?

I'd like to cause a plugin to restrict its loading of CSS stylesheets and JavaScript JS files to only those pages for which they are needed. An example for my question is the plugin Contact Form 7 ...