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.

34
votes
2answers
57k 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 ...
47
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 ...
29
votes
5answers
11k 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?
10
votes
2answers
11k views

WP Rest API: details of latest post including featured media url in one request?

I'm using wp-rest api to get posts information. I also use wp rest api filter items to filter fields and summarize the result: When I call http://example.com/wp-json/wp/v2/posts?items=id,title,...
16
votes
4answers
986 views

Who are the most trusted plugin developers? [closed]

Note: 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. There are so many plugins out there. Whose plugins can ...
8
votes
1answer
872 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 ...
29
votes
3answers
52k 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 ...
10
votes
2answers
9k 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 ...
15
votes
2answers
2k 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 ...
14
votes
6answers
4k views

How to include code only on specific pages?

I'm learning about plugins and shortcodes. I noticed that when I activate my plugin its code gets loaded on all of my pages-- even pages that don't have my shortcode. (I don't mean content vs. admin ...
5
votes
1answer
4k views

How to make simply “report” button on posts

I'm building up a video-site using wordpress. It embeds videos from different sites. I really need a simply "Report broken video"-button that saves the url in a database or emails it to me. I've ...
7
votes
1answer
4k views

Is it possible to define a template for a custom post type within a plugin independent of the active theme?

I'm writing a plugin to manage data about open-source projects. I developed an object model and have successfully created all custom post types and taxonomies, as well as implemented the correct ...
4
votes
3answers
4k 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 ...
4
votes
2answers
5k views

Preserve custom URL parameter on more pages

I created a custom URL parameter for sorting posts by their vote scores. I have a "most voted" link that sends a ?sort=most_voted URL paramater and using a query posts filter I display posts with most ...
7
votes
1answer
16k views

How do I cleanly override a plugin's CSS with a child theme?

I have taken it upon myself to adhere to WordPress conventions so I can have a clean, sexy child theme. However, I am unsure how to proceed on a certain issue. I would like to override the CSS for ...
6
votes
4answers
18k views

How to edit a wordpress plugin without break its update process

I would like to add some additional features/functionality with already available WordPress plugin. Is it possible to carry over my customization while updating the plugin?
0
votes
2answers
5k views

Multiple WP install with same users database

I am creating a e-commerce website. I am using woocommerce with some cool extensions I bought. I need to make 2 websites, but store the users database (purchases, subscription purchases, etc) as well ...
5
votes
1answer
811 views

Inherit plugin settings to new site in Multisite

I use the Breadcrumb NavXT plugin for a WP Multisite. I activated the plugin for all sites so I can use it throughout my network. My problem is that every time I add a new site I have to change the ...
4
votes
2answers
4k views

How to Override a Pluggable Function

How can I override a function in pluggable.php? I have tried making my own plugin -- got the fatal error on function already defined. I tried functions.php in my theme -- got the white screen. Is ...
1
vote
3answers
4k views

Any way to use a custom Parameter for youtube embed without using an iframe?

I do not want to display the titles of videos I embed on my wordpress site. The way I've been doing this is using the embed link, inserting the iframe in the wordpress post and adding the custom ...
14
votes
2answers
5k views

Registering Class methods as hook callbacks

I'm not sure if I have done this correctly. As I understand it: if I have a class foo and a static method bar I can register that as the callback by passing the array array("foo","bar") as the ...
10
votes
5answers
2k views

Syntax highlighting for post/page editor [closed]

Anyone know of a plugin that adds syntax highlighting to the post/page HTML editor? Thanks-
8
votes
3answers
9k 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 ...
8
votes
3answers
2k views

How can I make it so the Add New Post page has Visibility set to Private by default?

I'm trying to create a plugin that alters the Add New Post page so the Visibility field says "Private" by default: Status: Draft Visibility: **Private** Publish immediately [Publish] ...as opposed ...
7
votes
3answers
3k views

How to disable core and plugin updates

Is there any way to disable core and plugin updates? I am modifying a plugin and bit of WordPress Core (I know its a sin to do so), but can't help it.
6
votes
5answers
1k views

How to add custom content template part for a custom post type on main query using a plugin

I have a custom post type paper defined in my WordPress plugin that I show along with standard posts in the main query via: function add_custom_post_types_to_query( $query ) { if ( is_home() &...
6
votes
1answer
1k views

Validation error: Extending Gutenberg gallery block

I am trying to extend the Gutenberg core/gallery block to add some new functionality to my image gallery on the frontend. I have created a separate plugin to handle this task. I have registered my ...
4
votes
3answers
728 views

Handling jQuery Component Collision

In plugin development, what is the best practice to prevent jQuery component collision on the front end? For instance, let's say I include the jQuery Apprise dialog in a plugin that loads this on the ...
4
votes
1answer
6k views

Hook if somebody saves plugin options?

I wrote a plugin that has various options and in case the user saves this options a CSS file will be generated. My intention is that the CSS is only created when the options are saved and not when ...
3
votes
2answers
10k views

How do I create a custom wordpress slideshow plugin?

How do I create a custom wordpress slideshow plugin? I've been looking for the tutorials on google but I couldn't find one, would you guys mind giving a tutorial here or link to some other custom ...
2
votes
4answers
881 views

Wordpress media upload limit?

I've done numerous WP sites, written my own plugins, run my own server, etc etc. But I have not seen this before. I just installed a fresh 4.7.1 and installed the Proto theme and all its plugins. ...
2
votes
1answer
311 views

How to add terms to a post depending on its title?

I want to add all posts with keyword "Dog Training" in the post title to a specific category. Reason: If you enter something into WordPress search it's not an exact match. Previous WordPress search ...
1
vote
1answer
78 views

How to create a widget or plugin to add custom content to my website?

I've made a dropdown menu of multiple pages on one HTML page. Right now the only place to change the content of each page is inside the HTML of the theme. But this content will be changed weekly, ...
2
votes
2answers
160 views

WP plugin updates

I wrote a plugin for WordPress which requires regular updates. Is it possible to notify user of new version being available (some of the other plugins have some kind of this option - when new version ...
2
votes
2answers
189 views

Delivering a file instead of wordpress page

I'm trying to make a page where a user provides an ID of a attachment and the site will set the headers and deliver that file instead of a 404 page. so /download/1754 would lookup the attachment with ...
1
vote
5answers
4k views

Plugin Development: Wordpress processes twice on post update. How to skip process on the first?

When you create a plugin and set up a process function, Wordpress will run the plugin process function twice upon clicking the update button. I believe the first process is for the versioning (...
0
votes
2answers
2k views

How to override shortcodes.php core file?

I would like to override/update to core shortcodes.php file. Build an array and send data differently to other functions, but my question is how to do that without editing the core file? Is there a ...
0
votes
1answer
931 views

Can Not Redirect from Plugin-Registered Admin Page

I am doing the following in my plugin: Register a custom admin page and in the callback function (the last parameter of add_submenu_page) Redirect to another page However, when I open the custom ...
0
votes
1answer
289 views

Adding New Role

I have add new role in functions.php file by this code: // Add a custom user role $result = add_role( 'supplier_for_planvent', __( 'Supplier_For_Planavent' ), array( 'read' => true, // true ...
0
votes
1answer
5k views

How did you incorporate WooCommerce in your own WordPress theme?

This has most probably been asked before, but I really need to show WooCommerce products in my template, but I don't know what hooks to add where. It's my first time working with WooCommerce. Can ...
37
votes
10answers
15k 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 ...
38
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 ...
33
votes
5answers
89k 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 ...
28
votes
2answers
40k 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?
5
votes
1answer
14k views

Adding a Variable Product in WooCommerce Programatically

How do I make it a variable product and add variations? Are variations handled like attributes? this code creates a product and adds an attribute(XL size) but i cannot make that attribute used as a ...
15
votes
3answers
527 views

What are the common security flaws I need to look for? [closed]

As a wannabe WP plugin developper, what are the main security flaws/holes I should look for? I'm about to create a new plugin with a configuration panel (ie input fields and stuff). What should I be ...
29
votes
3answers
42k 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: ...
6
votes
2answers
15k views

how to create child WordPress plugin

I like to create child plugin.. Explanation :- I have one parent plugin named X. This will work independently (like other existing plugins). Now I decided to add some extra features to that plugin ...
9
votes
2answers
1k views

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

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 ...
1
vote
2answers
9k views

How to add users roles dropdown in registration in wordpress

How to add users roles dropdown in registration in wordpress function myplugin_register_form() { global $wp_roles; echo '<select name="role">'; foreach ( $wp_roles->roles as $key=>$...