Questions tagged [plugin-development]

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.

2,094 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
332 views

Custom collection in media manager?

I'm working on a plugin that extends the media manager, load JSON based input data to render an own collection of images and may upload them to my wordpress media library. So far I got my own tab, ...
Sacer's user avatar
  • 121
11 votes
0 answers
385 views

Hook in wp.media to add a new tab

This is an issue coming up while creating a plugin. I want to add a tab to the wp.media.view.MediaFrame.Select modal or if a general approach helps: In the customizer I want to hook in any modal ...
LeMike's user avatar
  • 388
6 votes
0 answers
459 views

Gutenberg Blocks doesn't render correctly when using do_blocks

I'm trying to render a post_content with blocks using the do_blocks function, that takes a gutenberg content, parses every block, and returns an HTML string. The problem is that some blocks aren't ...
Raba's user avatar
  • 406
5 votes
0 answers
483 views

How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg

If I want to extend the core block I can use Block Filters where I found a filter like editor.BlockEdit. Example from doc: const { createHigherOrderComponent } = wp.compose; const { Fragment } = wp....
kanlukasz's user avatar
  • 464
5 votes
0 answers
966 views

WordPress REST API call generates nonce twice on every call

I'm trying to login a user via the REST API, and then retrieve the current user on subsequent requests. As per the documentation, in my plugin, I am creating and retrieving a nonce after a successful ...
kvnam's user avatar
  • 101
5 votes
3 answers
1k views

Making plugin unique to not conflict with plugins with the same name

I have plugin that has the same name as other plugin uploaded to wordpress.org How can i make it unique so it doesn't share "View Detais" link and auto-update with other plugin uploaded to wordpress....
Danil Solodunov's user avatar
4 votes
0 answers
688 views

Developing the save function in Gutenberg blocks

I am editing the save function on my local wordpress instance. Every time I make a change, I need to manually click the "Attempt Block Recovery" button to see the updated change when I go to ...
prawn's user avatar
  • 163
4 votes
1 answer
323 views

How to save block attributes when the output doesn't change

I have a block with some settings that affect the editor only. So not the output. The issue is that when I change these settings, the output doesn't change. Then Wordpress does not detect the change, ...
Rob Monhemius's user avatar
4 votes
0 answers
74 views

Using Primary Color in Plugin Block

I'm developing a Gutenberg block, and I want the block to fit in as nicely as possible with the users site. So I'm trying to include as little styling of my own as possible, eg. allowing buttons to ...
Netråm's user avatar
  • 149
4 votes
1 answer
384 views

Is there any way to test if a function running only on plugin update is successfully running?

Is there any way to test if a function running only on plugin update is successfully running? Right now I am calling function if WP version present in configuration file is not same as plugin version'...
learning_13's user avatar
4 votes
2 answers
2k views

Advanced Custom Fields into functions.php

I'm trying to include a few custom fields I've created in my functions.php file so they're native to the theme I'm working on. However they're not showing up on the edit screens of the posts I've set ...
Josh Ade's user avatar
4 votes
4 answers
299 views

What is the Difference between directly call a function and call a function using add_action?

What is the difference between following two codes? (Directly call a function and call a function using add_action) function pp_submit__link_form(){ if(isset( $_POST['action']) && $...
DamithRuwantha's user avatar
4 votes
0 answers
194 views

permalinks with get variables

I'm trying to create my own permalinks with wordpress rewrite API. I have been registering my get variables as it follows add_filter( 'query_vars','driver_vars' ); function driver_vars( $vars ) { ...
kakuki's user avatar
  • 207
4 votes
2 answers
673 views

Wordpress scheduled task is called but not executed

I created a plugin with a cron to update all posts of a certain type every 5 minutes. I installed WP Crontrol to check if the cron is registered correctly and everything seems to be okay. This is how ...
Frederik Voordeckers's user avatar
3 votes
3 answers
2k views

How to automatically convert images to WebP on WordPress?

I want to convert every PNG and JPEG to WebP on upload so that I can serve WebP and PNG/JPEG without requiring the user to upload a WebP version of every photo. I want to save the WebP in the same ...
Ron's user avatar
  • 31
3 votes
1 answer
690 views

Using the <MediaUpload /> component outside the editor. select('core') is null

I am using the WordPress components in the admin panel of my plugin and trying to make an image upload button. The button works fine and allows me to select an image, but when I select an image, I get ...
Rafaucau's user avatar
  • 173
3 votes
1 answer
7k views

PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn't exist in wordpress/wp-includes/wp-db.php

I am writing a plugin and want to create a database table when the user installs / activates it I have written the following into an install.php global $wpdb; $fm_db_version = '1.0.0'; $db_table_name ...
Justin Erswell's user avatar
3 votes
0 answers
187 views

Gutenberg is there a way to know if the current block is reusable?

So I have developed some blocks using React, I save my css generated in the post meta, that's works fine. In the case of reusable blocks: Whene we set a block as reusable this block will saved as ...
Bill's user avatar
  • 31
3 votes
1 answer
307 views

Loading class files via autoload method

We have core classes created for theme and we are moving those classes to client-mu-plugins. Is there any way we can load all of the classes without adding require_once function for every single files?...
Jignesh Bhavani's user avatar
3 votes
0 answers
269 views

How to disable "Transform to" option in Gutenberg custom blocks

I prepared some non-standard Gutenberg blocks. They have a very specific purpose. Therefore, I do not want them to have the Transform to option available. What I found is the ability to use support: {}...
kanlukasz's user avatar
  • 464
3 votes
1 answer
2k views

How can I add a custom header to a custom template in a plugin without using the theme folders

There is a lot of documentation on how to create custom headers for a theme. For example, if I wanted to add a header named: header-custom.php I would add this to my template file: get_header('...
Jbingy's user avatar
  • 31
3 votes
1 answer
220 views

How can I translate the name of my Plugin for other languages?

How can I translate the name of plugin for other languages? For example: When Wordpress is in pt-BR language, the plugin would be "Meu plugin". If the Wordpress is in en-XX language, the plugin name ...
Lucas Vendramini's user avatar
3 votes
1 answer
288 views

Claim Listing functionality - how to send email to users when their claim has been approved or denied

We have a claim listing plugin, it allows items(posts) to be claimed by users. It requires the user to "register" in order to claim that item therefore they have to enter a username and their email. ...
jand1's user avatar
  • 31
3 votes
0 answers
3k views

How to get orders with used coupon in WooCommerce

Im trying to get orders in WooCommerce (ideally through wc_get_orders) where the coupon code "some_code" was used. My try: function get_orders_with_coupon($coupon){ $customer_orders = ...
Lukáš Kosař's user avatar
3 votes
0 answers
253 views

Gutenberg - What is the best way to save/update post meta?

What would be the best way in Gutenberg to save/update post meta (not from a block). I can't find an API for it. I was thinking of doing some ajax in componentDidMount using wp.ajax.post Any advice ...
DonPotato's user avatar
3 votes
0 answers
397 views

Wordpress password reset - why post rp_key?

I'm developing a plugin and after reading through wp-login.php, I can't seem to work out why some things are done the way they are. Why does WordPress hide the reset password key from the URL? After ...
Matt's user avatar
  • 88
3 votes
1 answer
786 views

$wpdb->get_results() does not fetch results with unicode 'WHERE' clause

I've just a simple query to fetch a students records by his name, written in Bengali. $student_rcrd = $wpdb->get_results("SELECT * FROM student WHERE name='আবুল কালাম আজাদ'"); Although my database ...
Tajin Ahmed Nipun's user avatar
3 votes
0 answers
48 views

Yoast SEO blocking/re-initialising longer running process

I have created a custom plugin, the job of which is to calls an external API to fetch data and fill in some custom tables in WordPress database. This is really a long-running process (maybe over 30 ...
Sunny Batabyal's user avatar
3 votes
0 answers
439 views

WP_Query with tax_query, order by most 'matches'

TL;DR: How can I sort a WP_Query based on how many 'matches' there are on the tax_query set. Furthermore, how can I then add more posts if the posts_per_page is not met due to the tax_query added? ...
Dennis's user avatar
  • 31
3 votes
0 answers
346 views

Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?

I have table with foreign key reference and i recently changed the create table query with ON DELETE CASCADE $wpdb->query("DROP TABLE IF EXISTS $table_name2"); //CREATE TABLE ...
Abhilash Narayan's user avatar
3 votes
1 answer
1k views

Woocommerce how to update variable product price programitically?

I want to update woocommerce variable product price by code. Here I wrote some code,, its create product but not update variable price: $post = array( 'post_title' => 'Product Title', '...
Mohammad Shahnewaz Sarker's user avatar
3 votes
1 answer
170 views

Detecting when a custom taxonomy has been changed and display alert?

I'm building a plugin with a CPT and custom taxonomy - location. Everything's been working fine except I need to add a dismissible admin alert when the custom taxonomy has been changed either from the ...
aberkow's user avatar
  • 240
3 votes
0 answers
84 views

Custom values are not translated

I'm trying to translate my plugin. Inside plugin's root folder I have 'inc' folder, where located registration.php file. This file has a code, which adds custom fields to comment form. (I use right ...
anton's user avatar
  • 1,033
3 votes
1 answer
105 views

How to create thumbnail of different files?

I am storing my uploads in a separate folder and using separate table to save the location in database. I have gone through WP_Image_Editor , wp_image_editor_gd and wp_image_editor_imagick . I also ...
Prafulla Kumar Sahu's user avatar
3 votes
2 answers
2k views

What is better way to use Bootstrap inside admin panel?

I need to use Bootstrap CSS for better UI in wp-admin but if I enqueue the bootstrap.css, it's affecting the admin default UI by changing background colors, etc. How can I use bootstrap.css inside wp-...
Bhavesh Nariya's user avatar
3 votes
0 answers
136 views

How to modify the new WordPress 4.5 link inline toolbar

I had my own plugin that add custom links options to the old wordpress link edition window (data attribute, nofollow etc). The new inline link toolbar introduced in WordPress 4.5 is ... not what I ...
Bactisme's user avatar
  • 129
3 votes
1 answer
616 views

Custom Taxonomy and tax_query Issue?

I am working on Plugin development and my plugin name is plugindev.I have a custom post type called team.I have a custom taxonomy Team_Category which is being registered by this code /****************...
raxa's user avatar
  • 610
3 votes
0 answers
618 views

Making a custom widget that includes a tinymce and works in Site Origin Page Builder

For a client I'm using Site Origins Page Builder plugin. It enables the client to make rich layouts for each page by dragging and dropping widgets. Site Origin widgets that require a WYSIWYG-editor ...
Wouter Vandenneucker's user avatar
3 votes
0 answers
363 views

Endpoint on Specific Page Slug

I have created an endpoint inside of my plugin: add_rewrite_endpoint( 'libstaff', EP_PAGES ); Now I would like to have the endpoint work for one page only based on its slug. In this case, I want it ...
Ravioli87's user avatar
  • 141
3 votes
0 answers
2k views

How to add quick edit and bulk edit fields to users admin section

Salutations, is there a way to add quick edit and bulk edit fields for the users section in wordpress. I have found a lot about post types and custom post types but i'm specifically looking to add ...
Digamber's user avatar
  • 187
3 votes
1 answer
769 views

How do I approach removing menu items on the fly based on settings in my plugin?

I've started writing a plugin that allows the administrator to select specific pages and set them to be visible only to logged-in users; the plugin optionally applies the restriction to all child ...
Phil Piper's user avatar
3 votes
0 answers
56 views

How ( and mostly at what time ) can i prevent the alternate cron from running?

I'm using the alternate cron version, but i need to prevent it from running on some calls, how can i do this? In the cron.php file i've seen on line 225 if ( defined('ALTERNATE_WP_CRON') && ...
Nicola Peluchetti's user avatar
3 votes
0 answers
239 views

Can I use core's "or Link to Existing Content" feature in my plugin?

When adding a link in the TinyMCE editor, you get a nice search with ajax function that searches your existing content and lets you select from it. Is it possible/reasonable to re-use this in a ...
MadtownLems's user avatar
3 votes
0 answers
163 views

Singular name Plugin localization

I'm trying to localize the singular name of a custom post type. ... 'singular_name' => __('key', 'plugindomain') ... I created a .po and compiled it as .mo. I also loaded the translation using ...
Donovan's user avatar
  • 213
3 votes
1 answer
2k views

Looking for callback function after Gutenberg is rendered?

On post/page editing screen, I want to call my functions as soon Gutenberg editor/whole page is fully rendered and visible. On WP 5.2.2, I have tried jQuery(document).ready(function () {}); and wp....
M-R's user avatar
  • 2,586
2 votes
0 answers
49 views

Gutenberg move post/page title to Editor sidebar document panel

I have not liked the way that the post/page title in Wordpress 6 / Gutenberg is contained directly in the block editor. I have found many ways to remove it with filters and / or restyle it but ...
Walrus's user avatar
  • 131
2 votes
1 answer
112 views

How do I display and edit other posts within the 'Edit Post' area of Wp-Admin Dashboard

I'm wondering how to edit the 'New Post/Edit Post' area of Wordpress. I want to create a new 'Screen Element' like the plugins do. I want this area to display all posts with a corresponding taxonomy ...
DJZEEGLER's user avatar
  • 119
2 votes
0 answers
36 views

Wordpress custom link with my plugin

I wrote a plugin that stored table wp_example(id, title, content, desc). It doesn't use post/page type. I want to add a link to the fontend, like index.php?option=my_plugin&show=all. If I use this ...
longanh's user avatar
  • 21
2 votes
0 answers
429 views

Gutenberg text field validation

I have been searching for ages but can't seem to find an exact method on how to perform text input validation when building custom blocks. I saw that for TextControl inputs you can just pass the ...
user8463989's user avatar
2 votes
0 answers
53 views

Hide categories that are not used in the post type

I have a situation where I need to display categories on the Archive Page of CPTs, but if the category is not used anywhere in the CPT, it needs to be excluded from the list. For example, I have a CPT ...
naveenkharwar's user avatar

1
2 3 4 5
42