Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugins]

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.

321
votes
108answers
151k views

Best Collection of Code for your functions.php file [closed]

Please vote on the question and any answers you find useful by clicking on the UP arrow on the left hand side of the question or answer. As with many others who are now viewing this post, I have been ...
134
votes
9answers
22k views

Tips for using WordPress as a CMS? [closed]

I want to use WordPress as a CMS for a reasonably basic site rather than a blog. I have several pages and at the moment, I don't intend to have a "news" page. While there are ways to make this work, ...
124
votes
13answers
86k views

Adding a Taxonomy Filter to Admin List for a Custom Post Type?

I have created a Custom Post Type called 'listing' and added a Custom Taxonomy called 'businesses'. I would like to add a dropdown list of Businesses to the admin list for the Listings. Here is what ...
107
votes
7answers
25k views

Updates for a private plugin?

If I write a private plugin, is there any way to use the WordPress auto-update mechanism to update it? I want to encapsulate the functionality, but it's specific to my own 5 or so blogs, so it's not ...
91
votes
2answers
49k views

Uninstall, Activate, Deactivate a plugin: typical features & how-to

I'm making a wordpress plugin. What are typical things I should include in the uninstall feature? For example, should I delete any tables I created in the install function? Do I clean up my option ...
82
votes
5answers
39k views

Best way to initiate a class in a WP plugin?

I've created a plugin, and of course being me, I wanted to go with a nice OO approach. Now what I've been doing is to create this class and then just below create an instance of this class: class ...
74
votes
3answers
27k views

Between functions.php, widgets and plugins, which is loaded first?

Customer asks if a specific carousel plugin he uses can be widgetized. That means I should create a widget inside functions.php which calls the plugin's function. That means that the plugin's code has ...
69
votes
18answers
5k views

WPSE Plugin Repository: The plugins that came out of WP-Answers

Link your WPSE-Plugins If you answered a question and made a plugin out of your code, than this is your place to share it. The Idea: An old comment from @MikeSchinkel during the beta phase where he ...
56
votes
3answers
11k views

Do deactivated plugins slow down a WordPress site?

Most people are aware that minimizing the number of plugins used is a good way to help keep a WordPress site running fast. However, does that general rule include deactivated plugins?
50
votes
3answers
65k views

Create custom page templates with plugins?

Is it possible to make custom page templates available from a plugin?
49
votes
8answers
28k views

Passing a parameter to filter and action functions

Is a way to pass my own parameters to the function in add_filter or add_action. For example take a look in the following code: function my_content($content, $my_param) { do something... using $...
48
votes
4answers
27k 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 ...
48
votes
1answer
7k views

What's the preferred method of writing AJAX-enabled plugins?

I'm wondering what the preferred method is for dealing with AJAX calls. Should one use the same plugin php file to process the POST or a separate one? Which is cleaner or safer?
44
votes
3answers
44k 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 ...
44
votes
16answers
9k views

How do you debug plugins?

I am pretty new to plugin authoring and was having a hard time debuging. I used lots of echo and it is sloppy and ugly. I am sure there is a better way to do this, maybe an IDE with a debugger that ...
37
votes
3answers
5k views

Add multiple plugin directories

The task You can register add additional Themes directories using register_theme_directory() for your WP installation. Sadly core doesn't deliver with the same functionality for plugins. We already ...
36
votes
7answers
37k views

Best way to overide plugin CSS?

Currently, I use CSS specificity to override plugin styles. I prefer this for editing the plugin as it makes less headaches when you update. It would be nice if my style sheet loaded after the ...
34
votes
2answers
75k views

Get Product id from order id in Woocommerce [closed]

I am having trouble with Woocommerce product details and order details relationship. I'm not able to find the product ID of a related order ID on the View Orders page of the Woocommerce theme. I ...
34
votes
2answers
55k views

How to add a shortcode button to the TinyMCE editor?

How to make any plugin icon in wordpress post? The code I want to insert in plugin code and will appear in post bar [wp-admin/post.php]. Like this image: Output: If I click the icon it automatically ...
34
votes
10answers
14k views

How to structure a plugin

This isn't a question about how to build a WordPress plugin. Rather, what, if any, guides could be applied to how to put together the file architecture of any plugin. Some other programming languages ...
34
votes
1answer
3k views

Is there a plugin that provides a stackoverflow style editor for wordpress? [closed]

I am tired of the tinymce editor in wordpress and I really love the stackoverflow editor which allows me to write with markdown grammar. So I want to write blog with markdown in wordpress. Now I am ...
33
votes
5answers
85k views

Translate a plugin using .po .mo files

I want to translate this plugin. The plugin has already been translated into other languages and it has .pot files for adding new languages (as far as I understood from description). How do I create ...
32
votes
7answers
3k views

What Plugins Demonstrate Great WP Plugin Development? [closed]

I'm going to be tackling my first plugin soon and I'm looking for plugins which you feel are of very high quality, under the hood. Stuff I can use as an example while I design the framework for my ...
30
votes
4answers
7k 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. ...
30
votes
4answers
1k views

How to implement a customizable free OpenID authentication?

OpenID is a standard commonly used nowadays. I am trying to implement OpenID on my blog, but I have many difficulties. I tried OpenID plugin but it seems to be incompatible with Wordpress 3.0. I ...
28
votes
3answers
40k views

How can I force a file download in the WordPress backend?

I would like to add a "Click to download" button to one of my WordPress plugins, and I'm not sure which hook to use. So far, hooking 'admin_init' to this code seems to work: header("Content-type: ...
28
votes
5answers
10k views

How can I stop WordPress from prompting me to enter FTP information when doing updates?

How can I stop WordPress from prompting me to enter FTP information when doing updates?
28
votes
5answers
2k views

Should all plugins be encapsulated in a Class?

When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts? Does using classes create performance overheads for PHP? If there is a performance hit, ...
28
votes
3answers
15k views

What are the differences between WPINC and ABSPATH?

It's common for plugin developers to protect their plugins from direct access. I saw two ways to do that: if ( ! defined( 'WPINC' ) ) die; and if ( ! defined( 'ABSPATH' ) ) exit; What are the ...
27
votes
1answer
21k views

Get a list of all registered actions

I'm trying to debug a plugin which I didn't develop and I want to list all the registered actions. I've read this SO thread: WordPress: How do I get all the registered functions for 'the_content' ...
25
votes
14answers
649 views

What Features would you Most Like to See Added to WordPress? [closed]

I'm creating a community wiki to ask the following question: What features would you most like to see added to WordPress? This Question Implies a Few Things: It should surface the features ...
25
votes
2answers
35k views

Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu

I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?
24
votes
3answers
9k 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 ...
24
votes
4answers
45k views

What security concerns should I have when setting FS_METHOD to “direct” in wp-config?

I have recently had an issue where I have been unable to install the WP Smush Pro plugin because I don't have the Manual Install or One-Click Installation options available. I came across this post ...
22
votes
3answers
5k views

'Global' settings page for multisite plugin

I'm working on a plugin that will be installed in a multisite instance. How do I create a single settings page that is visible at the "Network admin" level only - most of the guides i've seen relate ...
21
votes
13answers
2k views

What Are Security Best Practices for WordPress Plugins and Themes? [closed]

As suggested in this question, I am adding this topic as a new question, for community discussion/voting regarding best-practices for Plugin/Theme security. Here is the starting checklist, based on ...
21
votes
4answers
29k 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?
21
votes
4answers
3k views

Delete WordPress plugin Repository

I wanted to create a WP plugin. So I requested and my request was approved by WordPress.org But I don't want to develop that plugin anymore. How can I delete the repository forever or request its ...
20
votes
5answers
57k views

How to check if the product is in a certain category on a single-product.php in Woocommerce?

How in the world can I check if a product is in a certain product category on the single-product.php? <?php if (is_product_category('audio')) { echo 'In audio'; ...
20
votes
2answers
7k 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 this ...
20
votes
4answers
8k views

Show a different number of posts per page depending on context (e.g., homepage, search, archive)

In the Reading Settings, there is place to set the number of posts shown that affects the number of posts shown in all contexts. I'd like to show instead a certain number of posts on the homepage, and ...
19
votes
3answers
58k views

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

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 ...
19
votes
3answers
6k views

Implementing a CrunchBase.com Clone using WordPress?

I wish to create something like CrunchBase.com with WordPress.org (So to have one website that is a "database", and another one, which is a blog, that connects to it). Is it possible? and how? ...
19
votes
5answers
12k views

How can I make add_image_size() crop from the top?

I have a series of posts, all with featured images, but I need to be able to customise the crop top right corner. In this instance, I need them to be cropped from top right, but it would be useful to ...
19
votes
1answer
54k views

Given the ID of a product in woocommerce, how can I get its URL?

Say I have the ID of a product in wooCommerce; can I generate its URL somehow? (example /shop/fresh-apples)
18
votes
6answers
569 views

Are Wordpress Plugins essential?

I'm new to WordPress. I recently read an article about how hackers can exploit vulnerabilities in plugins. Various sources such as Google Pagespeed has also disssuaded me from using plugins or at ...
18
votes
4answers
1k views

Add Google Analytics manually, or use a plug-in?

Our situation is that we only dabble with Wordpress, however one of our Wordpress customers wishes to add Google Analytics to his site. I'm assuming we can do this manually, relatively easily. And ...
18
votes
3answers
898 views

How to enable suggested edits?

I like the idea of enabling any user of my website to suggest edits to a page. Much like the edit system on Stack Exchange but different in that anyone should be able to edit, not just registered ...
17
votes
2answers
16k views

In what order does WordPress load plugin files?

In what order are plugins loaded in WordPress? And within a particular plugin's folder, what order is followed for loading?
17
votes
1answer
12k views

Creating a plugin with dependencies

I am trying to extend the functionality of another plugin. I need to get data from it into an array to use in a different manner than the original plugin. (In this case, WPMUDev Categories and ...