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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

wp_delete_post returning WordPress database error unknown column 0

I want to delete some posts that have meta_key = xxx_generate_id programmatically, here is my code $arg = array( 'numberposts' => -1, // The number of posts to retrieve, otherwise 5 ...
user avatar
0 votes
0 answers
14 views

wp-ajax error 500 or Wordpress subdomain (same theme) doesn't access to wp-admin folder from plugin

I use subdomain on the same theme of main domain, developing a plugin, this one can't access to js file from a subdomain. To use subdomains with the same theme of domain I use that: switch ( $_SERVER['...
user avatar
  • 11
0 votes
0 answers
8 views

Serial Number from custom table not appear in woocommerce_email_before_order_table action

I have a custom table with serial numbers in WordPress. I have successfully got the serial number to appear on both Order received page after testing with Stripe: and it also appears on WooCommerce ...
user avatar
1 vote
2 answers
91 views

Wordpress simple 'Hello World' plugin - problems

I am an old-school embedded C programmer but a WP noob, so please bear with me. Here is what I have done so far:- Added a Shortcode in a Theme My function prints out 'Hello World' and is registered ...
user avatar
  • 11
0 votes
0 answers
6 views

Pickup date should be greater then today or today date should be disable [closed]

I am using a plugin BRW - Booking Rental Plugin Woo Commerce , I want if any customer select today date for renting a product , an error appear Pickup date should be greater then today or today date ...
user avatar
0 votes
0 answers
12 views

Font size of HTML content

I am developing a plugin. In this plugin I am outputting some HTML using short-code. User can choose font size of HTML content from Admin Panel. This plugin is saving font size as meta value in ...
user avatar
  • 387
0 votes
1 answer
10 views

Using "add_image_size" to register custom image sizes inside plugins not working

I noticed that most examples of add_image_size() is done via the after_setup_theme hook. Which means, for it to register, one has to switch theme and reactivate the theme. Which is not ideal for me as ...
user avatar
  • 139
1 vote
1 answer
19 views

Send retrieve password notification email with custom HTML email template

How to send custom HTML email for reset password? I know there will be a hook for that (retrieve_password_notification_email) But how to use it? Requesting for an example ...
user avatar
1 vote
0 answers
35 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 ...
user avatar
0 votes
0 answers
15 views

WordPress: redirecting to the form page after form submission to admin-post.php

I created my first WordPress plugin (I have a lot of coding experience, but that comes from the embedded software world). It includes a form, presented on the front end. To process the form entries, I ...
user avatar
0 votes
0 answers
16 views

Foreign wp_users ID in custom plugin DB table?

I'm creating a custom plugin that creates four custom tables when the plugin is activated. I have two tables that is using 2 foreign keys in one table and four foreign keys in the other. If I don't ...
user avatar
  • 1
0 votes
0 answers
16 views

Is it possible/advisable to set last stable version to previous version?

I have a plugin in which a critical bug was discovered. The bug fix has proven far more elusive than I hoped and now, while we dig in for an extended investigation phase, I'd like to at least remove ...
user avatar
  • 113
1 vote
0 answers
14 views

Wordpress Site is Broken, Cannot see wp-admin page [closed]

My wordpress site is broken after I tried to reset my site with some plugin called wp-reset. I tried below solutions to fix this issue but still not able to see admin dashboard: In phpMyadmin - db, ...
user avatar
1 vote
1 answer
52 views

WordPress Hooks : Where to place callbacks that repetitively yield the same effect?

To give you the context first: Let's say you create a custom plugin by yourself. That plugin has for example: A) 30 different endpoints / REST calls, B) adds 15 different admin pages to the wp-admin, ...
user avatar
  • 359
1 vote
0 answers
30 views

Is there a script to collect all hooks and filters provided by a plugin?

As a plugin developer who wants to provide better documentations to my customers I'm also including a dev section inside my docs. This section should contain all provided hooks and filters by my ...
user avatar
  • 207
2 votes
0 answers
23 views

How can I get a plugin to hook 'dbdelta_queries' -- a filter used during version update?

I have a plugin where I want to intercept database changes made during the upgrade process. It looks like the WordPress Way to do this is with the 'dbdelta_queries' filter. The trouble is, my plugin'...
user avatar
  • 457
0 votes
0 answers
25 views

PHP: $_SESSION destroyed after page reload for my custom session

I have develop a plugin for customer portal. For check login I have use custom session. Few month ago I have face this issue which create for session_start() function and I have already fix this. Now ...
user avatar
0 votes
1 answer
12 views

Plugin index page code executes multiple times

I am developing a plugin that sends emails to users on activation. I am using SendinBlue API for this purpose. Right now, I am testing with just one email address (hardcoded) and static content. The ...
user avatar
0 votes
0 answers
14 views

Not Able to Add New Class To CPT Attachment Image

Testing against WordPress 6.0 and using Codex, get_image_tag_class filter to remove all existing default classes and add new class img-fluid is not working Here is the code that I am using in ...
user avatar
  • 193
0 votes
1 answer
26 views

how to Update 15k products on plugin activation with meta_option

We need to update about 15.000 products with a meta_option after a plugin gets activated or after a plugin gets installed. However, our code does not execute on all products, though the plugin ...
user avatar
  • 149
0 votes
1 answer
16 views

WP Still Generating 150x150 Thumbnail Size Even After Un-Setting Small Size in Functions.php

I am using following code to prevent WordPress from creating some un required image sizes for my theme and only upload the original size add_filter( 'intermediate_image_sizes_advanced', '...
user avatar
  • 193
0 votes
0 answers
9 views

Displaying custom content from a plugin within the active theme

I'm currently writing a plugin that renders custom front-end content which should be displayed inside the body of the active theme. And after hours of Googling I'm not finding a solution. I am ...
user avatar
0 votes
0 answers
18 views

How to write a shopping queue line plugin with a queue button?

I am familiar a little with HTML and Css and an epsilon with PhP, Js, SQL and JavaScript. I want to write a shopping queue line plugin with a queue button (If there is no similar free WP plugin) such ...
user avatar
  • 101
0 votes
0 answers
27 views

Why does website stretch and white space on load? [duplicate]

On loading my friends website is stretching and has a white space. Does anyone know what is causing the white space and stretch on load ? https://bit.ly/treesurgeons
user avatar
0 votes
0 answers
11 views

Custom Settings Plugin Save foreach checkboxes

I have these functions that create a form with checkoxes that come with each product attribute(i used a foreach loop) and I'm not sure where it goes wrong here. I want to show all product attributes(...
user avatar
1 vote
0 answers
30 views

Mock a dependency of a WP_REST_Controller class

I have a custom WordPress REST API with a client for an external service being injected in its constructor; that client is going to be used internally in that class, like this: class ...
user avatar
0 votes
1 answer
22 views

send popup after wp_redirect()

Hello Wordpress Developer, I want to ask about how to send popup after wp_redirect(); I'm sending link to user for verify. I just want to let user know that the verify process is done. Here is the ...
user avatar
  • 5
0 votes
0 answers
21 views

Auto hyper link text matching slugs/pages

Is there a way to automatically hyperlink a text without actually adding the link using the Insert Link feature of WordPress? For example, I want to hyperlink HELLO WORLD and I click the insert link ...
user avatar
  • 1
2 votes
1 answer
34 views

Why would someone use function_exists('add_action') in a plugin?

I inherited the code of a proprietary plugin, and am now trying to clean it up. At the start of the main some_plugin.php file, there is this code: // Make sure we don't expose any info if called ...
user avatar
  • 123
0 votes
1 answer
26 views

How to add logo to a WordPress Custom Plugin?

I am trying to add a LOGO for my custom WordPress plugin, that I have created for a specific website. I have searched everywhere, and I have found nothing. What are the functions or hooks, that I have ...
user avatar
2 votes
0 answers
41 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 ...
user avatar
  • 133
1 vote
1 answer
30 views

Plugin custom post template; without overriding all posts

I've created a plugin and I am trying to include an post template that the user can optionally use. I've tried the following, add_filter( 'template_include', 'insert_my_template' ); function ...
user avatar
0 votes
1 answer
23 views

Store custom meta box data as serialized array

I have been trying to find out if it is better to store custom meta box fields for a custom post type individually or as a serialised array. On the web I have seen different approaches but which one ...
user avatar
1 vote
0 answers
51 views

Creating an installation zip file

I'm having trouble trying to produce an installation zip file for a gutenberg block that I've developed. I'm using wp-scripts plugin-zip to create the zip. In the past, I found that the name specified ...
user avatar
  • 11
-1 votes
2 answers
46 views

How to Pass ID through Short Code

How to Pass ID and fetch post meta data through Short Code like [my-shortcode id="12"] ? My code is like below. add_shortcode( 'my-shortcode', 'shortcode_function' ); function ...
user avatar
  • 387
0 votes
1 answer
32 views

Modify custom block plugin without losing content

I'm developing a custom block plugin with the standard environment built with: npx @wordpress/create-block my-plugin-name I have now inserted some content using this block. Works fine. Good! After a ...
user avatar
  • 485
0 votes
1 answer
37 views

Themes conflicts and overrides my WordPress Support widget Plugin styles

The front end of the widget plugin has the widget launcher and once opened, it shows the actual widget with its elements. it has lots of styling issues which are 100% from whichever theme is currently ...
user avatar
0 votes
1 answer
42 views

How to create ShortCode

I am learning Plugin Development. How to create ShortCode like the image ?
user avatar
  • 387
0 votes
0 answers
13 views

Metabox is not displaying

I am learning plugin development. My code is like below. <?php namespace Inc\Admin; class Admin { public function __construct() add_action( 'admin_menu', [$this,'news_meta_boxes'] ); ...
user avatar
  • 387
0 votes
0 answers
21 views

check_admin_referer()

How to use check_admin_referer() ? I read this link. But I am not clear.
user avatar
  • 387
0 votes
0 answers
12 views

Wp Meta Query does not work while simple Query Works

I have created a Custom Post Type and added 50+ posts. Now this post type have some meta values which I need to display. Here is how I created the post type: function colorshadescpt() { ...
user avatar
-1 votes
1 answer
41 views

Remove text from confirmation message

How can I remove View post words from Post published confirmation message ?
user avatar
  • 387
0 votes
0 answers
9 views

Downloading File via headers doesnt work

public function handle_bulk_action( $redirect_url, $action, $post_ids ){ $redirect_url = remove_query_arg( 'export', $redirect_url ); if( $action == 'export' ){ $...
user avatar
  • 1
0 votes
1 answer
36 views

Where to use nonce

I am learning WordPress Plugin Development. My Code is like below. class Admin { public function __construct() { add_action( 'admin_menu', [$this,'news_meta_boxes'] ); ...
user avatar
  • 387
1 vote
2 answers
22 views

How to add query args to links to CPT admin submenu

I have a custom post type I've created, and I've added an admin submenu page to display some data it generates. So far, so good. I'm displaying the data with my local extension of WP_List_Table, and I ...
user avatar
1 vote
1 answer
27 views

How to use nonce

I am learning Plugin development. I have several MetaBox call back functions. In this regard where should I use wp_nonce_field() ?
user avatar
  • 180
0 votes
1 answer
24 views

Disable Author Archive just for certain roles in bulk

Hi I have a lot of users that have the role in wordpress as "Buyer" I want to be able to disable these users archive page so it is not public but I want to keep public users that have the ...
user avatar
0 votes
1 answer
29 views

Catching Gutenberg sidebar switch event

I'm working on a plugin with Gutenberg integration. I registered a plugin in React, and my sidebar is showing and working fine. But I need to perform an action each time my sidebar is showing up. I ...
user avatar
  • 11
1 vote
1 answer
37 views

How to create post favorite function without plugins

I'm developing a lesson plan plugin ... and within this lesson plans you will have the option to favorite which plans users like, I'm listing the registered plans this is very easy using as a ...
user avatar
  • 21
0 votes
2 answers
40 views

Wordpress - Get Posts with Category data

i have a question about improving my solution. For my task i build a Gutenberg block which shows the latest 5 Posts. This Posts show also the Category Name in the Frontend part which have different ...
user avatar
  • 3

1
2 3 4 5
127