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
1 vote
2 answers
279 views

Execute callback after REST API request completes + Response is sent

In WordPress, is there an action hook or anything which allows you to run a callback after the response to a custom REST API endpoint, registered via register_rest_route(), has been sent to the client?...
DevelJoe's user avatar
  • 487
0 votes
0 answers
12 views

Generating Multiple Divi Pages from Database

I have a template in Divi that I want to use as the basis for generating hundreds of pages. I would like to replace some terms in the title of the page, as well as the body of the page, based on data ...
2567655222's user avatar
0 votes
0 answers
35 views

Change weird Wp File structure

I have to work on a wordpress project,ReactPress does not work and I think I've found why: It works fine this way except Reactpress, so I need to turn it back to original file structure. How can I do ...
Francis's user avatar
1 vote
0 answers
145 views

how to add contact form 7 shortcode in javascript variable [closed]

In Contact Form 7 I have created a dropdown with 3 options under it "Dallas" "Houston" "Austin" . I wrote this js code so that if I select Dallas then "Houston" ...
MD. RABIUL ISLAM's user avatar
0 votes
1 answer
471 views

How can I include React useState in a custom gutenberg block plugin?

The block code is as such: wp.blocks.registerBlockType('myblocks/gallery', { title: 'Gallery', icon: 'my-gallery', category: 'common', attributes: { }, edit: props => { const [...
budgiebeaks's user avatar
0 votes
0 answers
119 views

How to consume external API from WordPress post editor and display the response data in the custom field?

I am developing a custom post type called "Team," where I will add some profiles of team members. I am using ACF for the custom field to add personal details of the members (I can also ...
Rousnay's user avatar
0 votes
1 answer
168 views

plugin doesn't retrieve data from database

I wrote a code for a plugin which suppose to modify the WordPress dashboard to display a cog icon for each post in a column named "Optimize". I added an action to the icon that triggers the ...
Shima Masaeli's user avatar
1 vote
0 answers
27 views

ACF - programmatically install and activate in pipeline to automate testing for custom plugin development?

Original question on SO: WP plugin integretion testing - how to enable additional plugins? TL/DR I'm developing a custom plugin and setting up ci/cd via gitlab pipeline. Testing and publishing to ...
fudo's user avatar
  • 111
0 votes
1 answer
77 views

How to add extra EXIF data when images are uploaded?

I have a function to add EXIF information to an image after the image is uploaded to a website. How do I get the EXIF information to be automatically added to the image after the image is uploaded or ...
Kelvin Ngo's user avatar
0 votes
1 answer
317 views

Vanilla javascript in custom gutenberg block not working

I am trying to create a custom gutenberg block for a school project. I am new to this and I have not used the @wordpress/create-block method. I have created a plugin with a test block manually with a ...
user232026's user avatar
0 votes
0 answers
49 views

How to boost WP custom post REST API GET queries by custom taxonomies

Let's say you have a custom post type custom_type registered in your main plugin file. You also have multiple custom taxonomies registered in your main plugin file. All in all something like this: ...
DevelJoe's user avatar
  • 487
0 votes
1 answer
307 views

How can I modify the html output of a custom post type admin page?

I have three post types I have created inside a custom plugin: afilliates regions products I'm working with carbon fields to create fields to generate each of these post types To create a product ...
Anon's user avatar
  • 3
0 votes
0 answers
21 views

Display months on a drop down calendar as TEXT instead of Numbers

Trying to display MONTHS as TEXT (Juanuary) instead of NUMBER (1) in a drop down calendar (gravity form) I tried this code but if you select a MONTH and then press a button into the FORM it will ...
StonebridgeGR's user avatar
0 votes
0 answers
23 views

How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?

I am trying to build a custom functionality for my WP website, where I need to get the full amount of discounts aplied in given order. So far I am able to get the amount, rounded to a whole number (...
Mihael Manolov's user avatar
0 votes
1 answer
40 views

Is using upgrader_process_complete the correct way to perform plugin updates?

A couple months ago, I got my first WP plugin in the WP plugin repo. The plugin uses register_activation_hook with an attached function to create some custom MySQL tables to store data. Now that I'm ...
slanginbits's user avatar
0 votes
0 answers
320 views

Trouble Importing whatsapp-web.js in a WordPress Plugin Development

I create plugin I name it sendblast. Like other plugin, I make index.php, functions.php, sendblast.php with src and css folder with sub folder i name it modules. I install node js, npm init, and npm ...
Hendra's user avatar
  • 5
0 votes
0 answers
154 views

wordpress admin-ajax bad request 400

i have this select options here that is generated out from a wordpress table, it should hold all the clients i have, what i am trying to reach is when i select one of the clients from the select field,...
Mohamed Atef's user avatar
0 votes
2 answers
3k views

'useSate' error when using React on the frontend in custom block plugin

I keep getting this error with React on the frontend Uncaught TypeError: Cannot read properties of null (reading 'useState') I'm trying to use this hamburger component (https://hamburger-react....
Shelaine's user avatar
1 vote
1 answer
60 views

Getting similar posts by custom field value

I have several custom fields for my posts, one of them is called nearby, its role is to store cities that are close by. So let's say I have a supermarket called Janny's and its custom field for Near ...
Wordprez's user avatar
0 votes
1 answer
206 views

Wordpress plugin boilerplate AJAX functionality

I am using the WP-STRAP Wordpress plugin boilerplate https://github.com/wp-strap/wordpress-plugin-boilerplate . I want to send data from frontend via a form to backend with JS Fetch API. Upon request ...
Ion T's user avatar
  • 15
0 votes
1 answer
61 views

is_user_logged_in() undefined at shutdown in plugin context

The function is_user_logged_in() is not available at shutdown (plugin context, not theme). I want my plugin to run only (1) on front-end pages and (2) when the user is not logged in. This works, but ...
Jeff's user avatar
  • 125
0 votes
1 answer
63 views

Block Development: hamburger module throwing error in save function [closed]

*Edit - this was flagged for being off topic, which doesn't make any sense to me. This question is all about block development and the answer came down to my misunderstanding of the save component. ...
Shelaine's user avatar
0 votes
1 answer
29 views

Developing an IP lookup function using an API

I'd like to implement the ability to incorporate an API into my Wordpress blog that allows people to perform an IP lookup within my blog. So far all of my attempts have failed when incorporating the ...
skarz's user avatar
  • 111
0 votes
1 answer
453 views

Does WP REST API cache internally executed (rest_do_request) requests?

We have registered a custom REST GET endpoint using register_rest_route(), consisting in the retrieval of posts of a custom post type (my_custom_post). We're using our own endpoint to do so as we do ...
DevelJoe's user avatar
  • 487
0 votes
0 answers
45 views

Shortcode cannot parse attributes within double quotes. " is becoming ” breaking my shortcode

I made a plugin that creates a shortcode to calculate the time since a particular date in the past. It has two attributes, a date string and units: function timesince_shortcode($atts) { $atts = ...
Sidewinder's user avatar
0 votes
0 answers
342 views

how to check elementor is widget is active or loaded

I have create a custom widget for Elementor. I want to check with the code whether my widget is used or loaded (active) on the page or not? How can I do this? I want the styles related to the widget ...
alex dev's user avatar
0 votes
1 answer
538 views

esc_url, esc_url_raw or sanitize_url?

I know there's already this post here but its answers still leave me in the dark about these three methods. I'm a little confused by the selection of one of the methods mentioned in the title, if I ...
DevelJoe's user avatar
  • 487
0 votes
1 answer
232 views

How to access Elementor-navigation-elements via jQuery

I am currently working on a custom WordPress-Plugin in which I need to extend the menu of the Elementor-plugin (the menu on the left when you edit a page or post via Elementor). For some reason I am ...
Dennis's user avatar
  • 103
0 votes
0 answers
18 views

Pulsing circle before the post title (Breaking news flash)

I want to add a pulsing circle before the post title on my news site. When I create a new post I want a check button. If i checked it then there would show a pulsing circle before the title of the ...
bjovaar's user avatar
  • 21
0 votes
0 answers
31 views

wordpress wp_editor() does not support <style> tag

when using wp_editor() it creates a tinymce editor. when I adding html content to the editor, it automatically add <br> and <p> tag to <style> tag properties. and the styles do not ...
wprah's user avatar
  • 46
0 votes
1 answer
28 views

register_activation_hook doesn't execute without add_action('init','some-function')

I am building a plugin based on a boilerplate gerenrated on wppb.me The problem I am having is getting the register_activation_hook to actually execute without following it with add_action This is the ...
Doveman's user avatar
0 votes
0 answers
41 views

Load images from CDN and custom features to "Add Media" dialogue

I have a multisite setup with 10 different websites, and I want to integrate the platform (WordPress, custom built theme from scratch) to an Digital Asset Management System. What I would like to ...
user2868900's user avatar
0 votes
1 answer
117 views

Insert meta-description into Yoast-SEO input-field via JavaScript

we're currently working on an extension for the Yoast-SEO WordPress-Plugin. One of the features of this extension requires the meta-description within the Yoast-SEO-area to be replaced via JavaScript ...
Dennis's user avatar
  • 103
0 votes
0 answers
119 views

Run different permission_callback depending on HTTP method of custom REST API endpoint

Suppose you register a custom endpoint via register_rest_route, and you register multiple different HTTP methods to that endpoint, thus each with its own methods and callback keys, exactly as defined ...
DevelJoe's user avatar
  • 487
0 votes
1 answer
67 views

Hook a search form anywhere on the site, using a custom plugin

I'm new and I apologize if I ask an already existing question. But I can't find the information I'm looking for. I need to know how a search form works in wordpress. I'm creating a custom theme and ...
f3l1x's user avatar
  • 1
0 votes
0 answers
75 views

wp cron does not run when i am not logged in to wp admin

I create a cronjob with my plugin but it is very very strange when I am not logged in to wp admin dashboard the cronjob is not running and when i am not logged in to wp admin dashboard it is running ...
Usman Khan's user avatar
0 votes
0 answers
29 views

How can I chanage the user for the composer container in wp-env?

I run composer using wp-env: wp-env run composer install and it performs the action as the root user. Can I create a user as in dockerfiles, and run the composer by that user?
Meysam Kia's user avatar
0 votes
1 answer
43 views

Saving metabox updates causing fatal error

I'm teaching myself from a plugin tutorial dvd, everything was going fine. I've setup custom_post_types and the metaboxes with no issues. The issue i have is a fatal error when i update/publish the ...
fuzzy2023's user avatar
0 votes
1 answer
66 views

How to trigger plugin migration code when plugin updates?

I'm looking to run some migration related code when my plugin is updated to the next release. I've researched and yet to find any sort of hook/trigger which will be called when a plugin has ...
David's user avatar
  • 103
0 votes
0 answers
125 views

Adding a navigation with wp_nav_menu() to a custom block in the site editor

I'm using the create-block package to build a custom navigation block, and I'm running into an issue with getting the menu to display in my edit.js file. In my render.php file i have: <nav> &...
Hjude_design's user avatar
0 votes
0 answers
17 views

How to Save Category and Delete Category in same Function

I want to edit and save a category then exactly after saving delete the same category automatically. I think I need to use the function wp_delete_category() to delete a category that is currently ...
Angel Hess's user avatar
0 votes
0 answers
50 views

update_option with array_push adding mutiple copies

A plugin I'm working on checks if an option exists. If it does it will update that option by adding new values to the array. When I var_dump the new option value looks great, but when I check the ...
Stickel's user avatar
0 votes
1 answer
29 views

Loading all PHP files all the time or only when they needed in Custom Plugin Development [closed]

Should I include all my PHP files automatically or should I include a model or class when it is needed only? I used to use MVC PHP framework on which I only load needed models, helpers etc. But in ...
doraemon's user avatar
  • 213
0 votes
1 answer
126 views

warning wp session

my website is down and has this error Warning: Private methods cannot be final as they are never overridden by other classes in /var/www/vhosts/katalytes.com/httpdocs/wp-includes/class-wp-session-...
Maria k.'s user avatar
0 votes
0 answers
156 views

Why isn't custom sidebar panel not showing up in the Gutenberg Editor?

I am trying to add a custom Gutenberg sidebar panel but it isn't showing up. I'm not sure why though as I have the sidebar.js and then enqueue it in PHP. I ran npm run start and it compiled the JSX ...
JayDev95's user avatar
  • 169
1 vote
0 answers
123 views

extending a core block doesn't work inside the editor

i want to extend the group core block, and add to it a rotate inline style. i read and use the hooks. when i add the rotate it is saved and display correctly in the front. But nothing is changed in ...
Ron's user avatar
  • 125
1 vote
1 answer
763 views

Custom rewrite, url path with parameters to a page

I'm developing a plugin, that should display content according to two optional parameters in the URL. The following URL should all be treated by the plugin: /pluginpage/ /pluginpage/value1/ /...
Lorenz Meyer's user avatar
0 votes
0 answers
61 views

Ninja Forms: Front-End Forms, Post ID?

I have been scouring all day, trying multiple things to get the Post ID of the Create Post action within a Ninja Form and it doesn't seem to be possible. The reason I need to, is because the data that ...
dcolumbus's user avatar
  • 637
0 votes
1 answer
555 views

Submitting form to admin-post.php Wordpress

I've been trying to get a basic plugin to work and I have followed what seems to be the flow to get the form to post to admin-post.php. However, I only seem to get the white screen of death upon form ...
Yintii.eth's user avatar
0 votes
1 answer
82 views

Create a custom plugin with dynamic child pages listing database records

I am developing a simple lean and mean custom plugin which has the purpose to list records from some database tables. Goal is to list data via url /teams/{category}/{id}. I've created a basic plugin ...
Flapoor's user avatar