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

Custom Sort of Custom Post Type Breaks Admin Functions

This is linked to a previous question here: https://stackoverflow.com/questions/76095044/re-ordering-a-custom-post-type-query-performed-by-directorist-plugin/76095177#76095177 I am using a listing ...
MrChoop's user avatar
0 votes
0 answers
20 views

How to detect when the user clicks the publish/update button in Gutenberg Editor

I'm currently new to the Gutenberg block development. I was wondering if there is a way to detect when the user clicks the publish/update button? Reason for this is that i need to call a custom ...
randyk69's user avatar
0 votes
0 answers
9 views

WordPress Admin panel: Custom submit button, need to suppress JS refresh dialog popup warning

Question: Is it possible to remove the WP admin dialog popup when using a custom "publish" button? Consider this workflow: Custom post type that a special editor role [approver] will simply &...
Christian Žagarskas's user avatar
0 votes
0 answers
9 views

how to decrease the size of wordpress site after installing the wordfence

Recently i had a malicious attack on my wordpress website through the EA for elementor , after that i downloaded some plugins for security and monitoring activity , like activity log for logs and ...
Prince Bhati's user avatar
0 votes
1 answer
20 views

Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it

This question is loosely related to Why some plugins are including wp-includes/plugin.php file? What I'm trying to figure out is, when is it smart to include this file, and when isn't it? I'm building ...
Daan van den Bergh's user avatar
0 votes
1 answer
21 views

WordPress custom block: Link saved in database not retrieved when editing post

I'm creating my first custom block for wordpress which must add two buttons and I need to insert the link of the two buttons. But after updating the post the link is saved, however if I enter the post ...
1001Songs Clips's user avatar
0 votes
1 answer
11 views

Remove Gutenberg Buttons Block

Is there a way to remove the default core/buttons block in Gutenberg, or other various blocks? We're creating our own buttons block and don't want the user to get it confused with the default one and ...
null's user avatar
  • 101
1 vote
1 answer
55 views

Allow manage_options capability for specific user only for specific plugin?

So typically, most plugins require the manage_options capability to access their options pages. Some plugins offer a hook that allows you to assign a custom capability that will grant a user access ...
jsherk's user avatar
  • 187
0 votes
0 answers
8 views

High-Performance Order Storage conflict action `manage_shop_order_posts_custom_column`

I use this to add an Ordered Products column right after the Date column (fits nicely there). Each product is also linked to it's proper edit page. Look like this: This is my code to do this: // -----...
vanloc's user avatar
  • 125
0 votes
1 answer
16 views

select rows based on exact time (hours, minutes and seconds)

I want to update my wordpress posts based on exact time including hours, minutes and seconds, I tried the simple where clause, it seems ignoring the minutes and seconds, here is my simple query: $date ...
Bill's user avatar
  • 31
0 votes
1 answer
25 views

Wordpress wp_set_object_terms does not assign product to custom taxonomy

I have create a custom taxonomy called regions with acf. and have create also a select option on dokan multivendor dashboard where they can create new product <?php $regions = get_terms([ '...
tilamap365's user avatar
0 votes
0 answers
22 views

Extend backbone for add new custom Rest Api

I would like to know how i can extend the backbone from wordpress to be able to add custom rest api? I have created a wp-extend-core/v2/themes-generated endpoint, and to be able to use it in admin I ...
Blaga Vasile-Alexandru's user avatar
0 votes
1 answer
26 views

How to provide page_template path in custom plugin using WordPress

How we can provide page_template path in custom plugin using WordPress? I given a path in page_template='templatepage/checkoutpage.php' as array of post.Inserting post data by wp_insertpost() function....
Mallesh's user avatar
0 votes
1 answer
31 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
  • 435
0 votes
0 answers
5 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
18 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
24 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
41 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
28 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
37 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
16 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
39 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
48 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
15 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
  • 435
0 votes
1 answer
39 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
19 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
11 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
14 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
71 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
27 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
185 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
41 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
58 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
  • 13
0 votes
1 answer
25 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
42 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
23 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
114 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
  • 435
0 votes
0 answers
26 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
46 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
111 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
  • 435
0 votes
1 answer
35 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
  • 101
0 votes
0 answers
16 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
16 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
24 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
8 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
26 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
  • 101
0 votes
0 answers
36 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
  • 435
0 votes
1 answer
29 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
13 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
13 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

1
2 3 4 5
131