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
1 answer
74 views

Gutenberg InnerBlocks noallowedblocks on parent but allowedblock on Child

This is a continuation of the following post: Custom Gutenberg block with nested InnerBlocks renderAppender not displaying add button I solved one problem but created a different problem. I'm ...
Phil Huhn's user avatar
0 votes
1 answer
21 views

Warning: Cannot update a component (`Unknown`) while rendering a different component

I'm trying to pass the clientId from the parent block to a child block. I need to stuff the clientId into an attribute value. When I use setAttribute trying to assign the value to sliderId, I get ...
Phil Huhn's user avatar
0 votes
0 answers
25 views

Redirrect after facebook successful login to wooommerce cart page url

I am building a woocommerce plugin for facebook popup modal login. if user click on add to cart button, modal will displayed for login, after successful login, product will be added to cart and ...
Safayet hossain's user avatar
0 votes
1 answer
33 views

How to change the version of block.js and plugin to the same of Package.json?

I am using the npx @wordpress/create-block tool to create my custom block plugin, during the initial installation a number for version that is inserted in package.json, dts-dyslocosaurus.php metadata ...
Giovanna Penna Eirada's user avatar
2 votes
1 answer
140 views

Custom Gutenberg block with nested InnerBlocks renderAppender not displaying add button

I'm converting a carousel/slider from a shortcode to a Gutenberg block. I got the first Gutenberg version working, but I want to convert that to use a InnerBlocks template, so the rich-text blocks ...
Phil Huhn's user avatar
1 vote
1 answer
102 views

What are the implications of having main plugin file name different to plugin slug?

I have inherited a plugin. If the plugin is called example and is in /wp-content/plugins/example what are the implications if the main plugin file is called example-plugin.php and not just example....
Steve's user avatar
  • 277
0 votes
1 answer
33 views

How to assign to each output values from foreach loop to a meta_key?

For a custom plugin with add start and end date of event/post, I must generate several datetime with the same meta key to compare the period of event with the period of weeks. I my case I'm obliged to ...
imagIne's user avatar
  • 41
0 votes
0 answers
24 views

How to fetch WordPress Gallery Images to a Custom Post Type?

I am using the WordPress Email Contact Form plugin to create a custom contact form. I want to be able to fetch images from the WordPress gallery and display them in the contact form. I have tried ...
Muhammad Usman Qureshi's user avatar
0 votes
1 answer
29 views

add_action() not working for admin

Making my own custom plugin and using add_action several times without a problem with one exception. Currently function below are located in functions.php in the appropriate themes folder. function ...
PerK's user avatar
  • 28
-1 votes
1 answer
22 views

Custom rest fields not loaded in rest api cpt response

I have a custom endpoint that will be used from my vue app to load custom post type I've registered using a custom plugin. I need to add some custom fields to the response when the posts are loaded ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
30 views

How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block

I want to create a custom Gutenberg block(react js) and I want to list the latest 5 posts from each author as a list item. Can anyone share an example, please? Below is the working Gutenberg block ...
Mangesh Yadav's user avatar
0 votes
0 answers
21 views

Pretty URLs for dynamically created product and pagination pages

I want to make a simple WordPress plugin that dynamically generates a paginated listing of elements of an array and product pages for each element. It examines if the current URL contains the query ...
pete8345's user avatar
0 votes
1 answer
25 views

Remove custom menu pages for admin users

I've added some custom menù pages to my WordPress dashboard using the add_menu_page() function. I need to remove these pages for super admin roles, but the remove_menu_page() seems not working. This ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
26 views

Multimedia upload error in my wordpress job board plugin

I have the below code in my plugin. Admin is meant to be able to insert funding_amount, funding_deadline, and funding_multimedia_field from the dashboard if the resource category chosen is funding. ...
ADEMESO DAMILARE's user avatar
0 votes
0 answers
15 views

TinyMCE - Unable to load the editor in vue front-end plugin page

I have this code in my plugin page that is created using vue 3. I need to use the wordpress editor and I'v used the wp_enqueue_editor() function to load all the needed assets of tinyMCE. in the vue ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
16 views

Custom uploader - Upload files and save link into database

I'm working on a file manager plugin. I need to store the saved files in custom folders and save the link into database to be able to get all the files and folders structure inside my vue front-end. ...
ICTDEV's user avatar
  • 113
0 votes
1 answer
28 views

Does a wordpress custom plugin is fired by default on php theme ajax request?

Inside My custom wordpress plugin to translate all posts depending on get_locale() I created a php file that's add_filter() to each post content element. Ajax requests are called from functions.php ...
imagIne's user avatar
  • 41
0 votes
0 answers
30 views

Implement Google SSO in custom plugin

I have this code that is used for the callback of a custom route public function login_user_with_google( WP_REST_Request $request ) { $client = new Google\Client(); $client->...
ICTDEV's user avatar
  • 113
0 votes
0 answers
21 views

Unable to use correctly composer autoload in plugin file

I've installed google php client library because I need to integrate some google services inside my wordpress dashboard. I've some classes that I will need to load inside my main plugin file, I've ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
9 views

my worrdpress admin bar shifetd into left and it force to dont work proper something. anybody know to how solve it

my worrdpress admin bar shifetd into left and it focre to dont work proper something. anybody know to how solve it
m f's user avatar
  • 1
0 votes
1 answer
33 views

show_admin_bar filter not called inside plugin class

I have this code inside my plugin class, what I want to achive is to hide the admin bar to non admin users and custom roles of my wp setup function hide_admin_bar() { if( !...
ICTDEV's user avatar
  • 113
0 votes
0 answers
32 views

All Pages and Post are redirecting to 404 Not Found in wordpress

I am using wordpress, I have created 3 pages and 4 posts on my website. I am able to access the front page but the rest of the pages are showing 404 not found, Same for post also. If I use some logic ...
Naren Verma's user avatar
0 votes
0 answers
11 views

Show posts in custom order

I am creating a custom plugin which shows custom order for posts for different categories. Hereby on plugin activation i am calling a function which stores order of newly created posts as here meta ...
Manav Chauhan's user avatar
1 vote
1 answer
65 views

Why does WordPress not make use of gettext directly?

When you develop WordPress plugins and internationalize them, the official WP docs instruct you to use gettext, by generating the according .po and .mo files. When your .mo files are however put to ...
DevelJoe's user avatar
  • 487
0 votes
0 answers
25 views

Updating wp_postmeta from meta_keys and meta_values from another table having price and sku only

UPDATE wp_postmeta pm INNER JOIN wp_postmeta as pm2 on pm.post_id = pm2.post_id SET pm.meta_value = 'price such as 45' WHERE pm.meta_key = '_price' AND pm2.meta_key = '_sku' AND pm2.meta_value = '...
Syed Bilal Ali's user avatar
0 votes
0 answers
11 views

Wordpress ajax form submit post url return 404

I'm trying to submit my custom form information, and catch the data from custom endpoint, but when submit the form through ajax, it always return post url not found, 404. In my php class: class ...
Basco's user avatar
  • 1
0 votes
0 answers
10 views

WooCommerce Checkout - Validate User Role

I'm facing a challenge with WooCommerce's checkout process. I use the "B2B for WooCommerce" plugin to differentiate between regular and B2B clients. I have two product categories "...
helio's user avatar
  • 1
0 votes
1 answer
33 views

I have created a custom plugin. After activation it creating page but i am not getting how to add another php file at page content?

I am little bit confuse. I have created a custom plugin and added a functionality to create a page automatically on activating the plugin. But i want to add form fields that is so much bigger form so ...
Aman Gupta's user avatar
0 votes
0 answers
15 views

Can't delete reported post

I made a plugin for report posts on WordPress, the report post input was successful. but when I tried to delete the report post data on the admin page it didn't work. sorry if my english is bad. <?...
Alson's user avatar
  • 1
0 votes
1 answer
44 views

REST API - filters not working inside plugin class

I have this code inside plugin I'm writing. I need to add some filters to customize WP REST API anyway I'm noticing that filters seems not working if( !defined( 'ABSPATH' ) ) { exit; } class ...
ICTDEV's user avatar
  • 113
0 votes
1 answer
29 views

Theme / Divi change visitor css and site logo and all site urls based on REQUEST_URI non logged in wp user

I am trying to store the baseurl to options table in wordpress for non logged in users. Basically if the user was referred to url mysite.com/go/affilatename I want to store affilatename (baseurl) to ...
GURU mcewan.marriott's user avatar
0 votes
1 answer
17 views

Query custom fields with three dates - start and end does not work

I have tried to make a reservation system for a book a table in restaurant. But, I have a problem when I try to see/ make new reservations in an specific day - in showing me which table are free at ...
Fujitsu09's user avatar
0 votes
1 answer
22 views

the second js file enqueued inside wp plugin isn't read

Inside a wordpress plugin : The second enqueued js file isn't read, need I specify something ? Does registering is necessary when several js files are called (enqueued) ? function ...
imagIne's user avatar
  • 41
0 votes
0 answers
19 views

I have issue to retrive post thumbnail with rest api

I have issue to retrieve post thumbnail function display_latest_blog_posts() { ob_start(); // Start output buffering // Replace with the URL of your blog site $blog_site_url = 'http://www....
mohsen hasanpoor's user avatar
0 votes
1 answer
13 views

Read page- or post-content across different builder-plugins

I am currently working on a WordPress-plugin to analyse post- and page-content. The plugin contains a php-function that read the post- and page-content across several different builder-plugins (such ...
Dennis's user avatar
  • 103
0 votes
0 answers
110 views

Custom block padding control (via support) initialization

I'm building a custom block control. I'm trying to let Gutenberg handle formatting via the support section of the block.json file as follows: "supports": { "type": "...
Phil Huhn's user avatar
0 votes
0 answers
19 views

WordPress custom block: How to treat each button as a separate block?

I created a custom block to include two buttons in the gutemberg editor. However, in some cases I need to delete a single button, but gutemberg treats the 2 buttons as a single block, see: import { ...
1001Songs Clips's user avatar
0 votes
0 answers
34 views

Wordpress 6.3: WPallimport not taking images from Network Media Library

Setup: Wordpress 6.3 Multisite with Woocommerce Plugins: Network Media Library and WPAllimport Network Media Library is setup to take images from Site 1. WPAllimport is activated on all multisite sub-...
user2240778's user avatar
0 votes
0 answers
45 views

Short custom plugin to send email to users

I have created a very short plugin that is working with a cron job running the below function once every 3 months. I will explain the steps inside the function: Fetching Producers(a list of users ...
Honoluluman's user avatar
0 votes
1 answer
84 views

Wordpress 6.3 with datatables - cannot seem to pass json from php to javascript

I have a basic plugin that pulls tileset data from mapbox in json. I then want to send the json data to my custom javascript to display it. If I pass the data using wp_add_inline_script I can ...
spreaderman's user avatar
0 votes
1 answer
68 views

Wordpress 6.3 headers already sent error

I need to refresh my screen after curl has run but I get "headers already sent" error. This is my code which is a plugin. function fs_settings_admin_callback(){ if ($_POST['generate']){ ...
spreaderman's user avatar
1 vote
1 answer
165 views

How to secure custom endpoint for rest api in Wordpress

I have several endpoints under fs/v1. I was to require authentication even for GET requests. How is that implemented please? add_action('rest_api_init', function(){ register_rest_route('fs/v1', '...
spreaderman's user avatar
0 votes
1 answer
142 views

How to disable pagination in Wordpress' API results?

I have the following code, however, regardless of the numberpost in $args, I always get the default number of records set in my settings which is 6 and I have 200+ records. Is there any simple way to ...
spreaderman's user avatar
0 votes
1 answer
34 views

Wordpress Media Uploader not displaying image that has just been uploaded

I am trying to implement a custom WP Media uploader within a plugin. I want multiple images to be uploaded also. I have the following javascript to open the media uploader. The modal opens fine and ...
JadeTech's user avatar
0 votes
1 answer
179 views

Custom fields in the billing address section woocommerce

I have added custom fields in the billing address in Woocommerce checkout page, this works fine. Now I would like to show these custom fields inside the "billing address" box in the email ...
LesCa's user avatar
  • 21
0 votes
1 answer
28 views

Wordpress theme development - the template dropdown in Pages and disappeared

I am developing my own theme. I have always seen the template dropdown in pages but now the template dropdown is suddenly gone. Any reason and how to do I get it back? No errors seen on page. The ...
spreaderman's user avatar
0 votes
0 answers
45 views

Custom block based off core block using filter

I would like to create a new block, "Custom Paragraph," based on the "core/paragraph" block but with the color and typography options removed in the inspector controls. I've ...
dancingrobots's user avatar
0 votes
0 answers
125 views

woocommerce_checkout_order_processed hook priority not working between plguins

I have a website with 2 plugins that use the woocommerce_checkout_order_processed hook. Plugin 1 uses the hook with priority 10 like so: add_action('woocommerce_checkout_order_processed', [$this, '...
odedta's user avatar
  • 76
0 votes
2 answers
89 views

Add custom CSS for plugin admin Page

I am trying to add custom CSS for plugin admin Page. If I use below code then it is working. wp_enqueue_style( 'cricket-info-admin-styles', plugins_url('') . '/wp-cricket-info/assets/css/admin_styles....
abu abu's user avatar
  • 183
0 votes
0 answers
40 views

How to add image in wordpress custom plugin?

I am looking for how to add images in a custom database table using WordPress code I am new in WordPress plugin development. I've created code for a plugin named store plugin. I've taken fields like ...
Khushbu Joshi's user avatar