Questions tagged [wordpress-plugin-creation]
449 questions
22
votes
3 answers
How to create Child Plugin for wordpress
Actually I have changed some code in WordPress Store Locator. I want it to remain when plugin will update. So I want to create a child plugin for that. Any ideas on how I could manage it?

Jalaj Kumar
- 491
- 1
- 3
- 12
8
votes
3 answers
How to enqueue alternate, icon, and manifest links in wp_head?
I'm trying to render meta, icons, and app store code in the head from my plugin, but it got rejected by the WordPress plugin review team:
Please use wp_enqueue commands
This is what I'm trying to add:
add_action('wp_head', array(&$this,…

TruMan1
- 33,665
- 59
- 184
- 335
7
votes
1 answer
How to handle/manage custom images?
I am working on a special plugin for a customer.
The situation in short:
The plugin contains a automatic import for a .zip file. Inside this files are one .xml file and images.
The plugin reads the .xml file and insert the information to the…

yfain
- 509
- 7
- 23
6
votes
1 answer
Where to register REST route to wordpress plugin endpoint
Where must the registration function go? (register_rest_route())
Must it be in theme/child functions.php?
Or can it be in the plugin base php file? (e.g. \wp-content\plugins\example\example.php)
Is there any documentation that clarifies this?
It…

ed2
- 1,457
- 1
- 9
- 26
5
votes
1 answer
index.php // Silence is golden in every folder?
Should I include a index.php with //silence is golden to every folder in my plugin? even css, js and images folders? Or is it just folders that contain code/ php files that should have the index.php file in it?

Herr Kingsley
- 128
- 1
- 7
5
votes
1 answer
WordPress - Programmatically insert Elementor Widgets in a page
I have Elementor Pro installed on my WordPress website and I was writing a custom plugin that will do some stuff and programmatically creates a new Page. I was able to create the Page, but the problem is, I want to insert an Elementor Widget…

Vpp Man
- 2,384
- 8
- 43
- 74
5
votes
1 answer
How can I get my Wordpress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
I have written a Wordpress plugin which places several buttons inside a metabox on the post-edit page. I'd go to example.com/wp-admin/post.php?post=number1&action=edit. I want my Wordpress hook to receive an AJAX call, and in turn makes a request to…

AviG
- 362
- 2
- 14
4
votes
0 answers
GiLab CI fails: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
I did set quite high memory in GitLab CI, stated at 8MB but I tried even 14GB, but I still get this error:
NODE_OPTIONS: --max-old-space-size=15032377839
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out…

János
- 32,867
- 38
- 193
- 353
3
votes
1 answer
wp_remote_get and url parameters
I'm trying to use an API with wp_remote_get which requires pagination.
Currently, my WordPress plugin calls the API the following way
$response = wp_remote_get( "https://api.xyz.com/v1/products" ,
array( 'timeout' => 10,
'headers' =>…

Jan v
- 51
- 4
3
votes
4 answers
how to avoid errors in vscode when making a wordpress theme?
How to avoid errors due to not having the specific functions of wordpress inside the projet when making a Wordpress Theme on Visual Studio Code ?
Is there a plugin to download ?

Benoit Adam
- 69
- 7
3
votes
1 answer
Custom shipping rates programmatically in Woocommerce
I Want to calculate custom shipping rates based on cart amount for woocommerce, My requirement as follows,
Cart amount
0-10 => £4.99 (shipping_rate_id = flat_rate:12),
10-20 => £3.99 (shipping_rate_id = flat_rate:13),
20-30 => £2.99…

Chandima
- 33
- 1
- 6
3
votes
1 answer
How to Set Notification Email in WordPress for Fatal Error Handler (WSoD)
WordPress 5.2 integrated WSoD protection which by default it will send an email notification to admin when the site encounters some fatal error. I had built my client a site which I would like to monitor such error in case it happens, but I dont…

HW Siew
- 973
- 8
- 16
3
votes
2 answers
WordPress rename attachment file with working thumbnails
I'm trying to write a function to rename the attachment file, both on upload, but also after upload.
I've written a nice function that can do this, but it results in missing thumbnails in the WP dashboard. I suspect it's because the GUID becomes…

Drew Baker
- 14,154
- 15
- 58
- 97
3
votes
1 answer
Send form data to WordPress database table
I am trying to build a plugin that will allow the admin to add data about a particular package ( just like creating User). In the front end I will have a form that will allow the visitors to search for a particular package using an id that was…

Britchi2
- 37
- 1
- 7
2
votes
1 answer
Creating a Wordpress block that fetches api data
I am new to wordpress development so i am struggling with the following problem:
We want to create a custom block in wordpress that gets data from an api endpoint and displays it inside of a richtext by replacing placeholders with the data from that…

Christian
- 31
- 4