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
0answers
23 views

How to use action response in a plugin for rest api

This must be something very simple, but I cannot figure it out. I'm working on a plugin, that extends a theme's functionality to rest api. Theme has an ajax action function that updates user profile. ...
1
vote
0answers
18 views

Does wp_login only trigger before an user signs in into the admin panel?

Saw this bit of code in a plugin: public function wp_login($user_login, $user) { Identify::create($user->ID); } Fires after the user has successfully logged in. In the doc it says that it ...
1
vote
0answers
14 views

How to enable sorting in custom media uploader in plugin

In my plugin I need a media uploader exactly like the one you see when you select a post's featured image. I managed to do almost everything with this code: media_uploader = window.wp.media({ ...
0
votes
0answers
5 views

How to let costumers send invoice after checkout to diffrent email [closed]

i would like to know if there is any way to let user after check out to input a custom email to send the invoice too. for exemple : 1-user place order 2-a thank you page appear with all the ...
0
votes
1answer
21 views

Hook after attachment added and cropped

I am looking for hook, that fires right after image uploaded, cropped for thumbnails and data posted to database. I need it for image optimization after uploading. I tried add_attachment and it fires ...
0
votes
0answers
24 views

How to upload large media file in chunks, without any plugin?

How to upload large media file in chunks, without any plugin ? I have done something like this, it's uploading the file, but after uploading the media file, the uploaded file is not visible in media ...
0
votes
0answers
10 views

How do you implement a blog subscription service? [closed]

I need to send emails to people who subscribe to our blog without using a paid service like mailchimp. What's the easiest way to do this? I need a widget that takes the emails of the users, so I ...
0
votes
1answer
11 views

Why won't this submenu page show? - My First WordPress Plugin

Starting to build my first plugin and I'm completely puzzled on why the submenu page won't show? The main page shows up, not the subpage. I've run over the syntax what feels like a million times and I ...
-1
votes
0answers
15 views

Word press Plugin UI conflict with other themes css

I need two clarification from the WordPress plugin developer. If we are developing any new plugin using that is not going to be usage of WordPress admin user , it will create 2 new pages in the front ...
0
votes
0answers
26 views

WordPress plugin development theme issue

Developed the WordPress plugin using https://materializecss.com/ framework , Once plugin activated it will automatically create 4 pages in WordPress. Here I'm facing one issue with WordPress multiple ...
0
votes
1answer
20 views

(Wordpress 5.8.3) Function.php or a plugin for better performance? [duplicate]

I'm working on an e-commerce site and a lot of customization needs arise. There are many codes in the child theme. Hundreds of lines... I always have this question in my mind: Is it better to write a ...
0
votes
1answer
20 views

Hook add_attachment error

I am trying to optimize my images when uploading to website. I trying to write plugin, that will use hook 'add_attachment' and after attachment uploaded do image converting. add_action( '...
0
votes
0answers
11 views

Add Free Gifts to WooCommerce Site [closed]

How can I add a free gift option to my woocommerce site? It should work like this: The customer can choose from a variety of gifts. The gifts are obviously free, but they should have a certain value (...
0
votes
0answers
8 views

Using Formidable Forms plugin, how to handle errors/exceptions in the frm_after_create_entry hook? [closed]

I'm using the Formidable Forms plugin. I've created a form and added it to a page. The form id is 2. Per this link, I'm using the frm_after_create_entry hook to do some extra processing. add_action('...
0
votes
2answers
32 views

Basic question about accessing scripts in my plugin

.Net developer here trying to learn some of the basics of wordpress. I have a basic question but I guess there's so much that I don't know that I can't even get a relevant result when searching here ...
0
votes
1answer
9 views

How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?

How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media? function theme_a_header_metadata() { global $post; $image = \...
0
votes
2answers
44 views

Filter for admin (back end) 'reply to' comment

Looking for the filter hook for the admin/comments/reply to process (where you use 'reply to' in the comments administration screen). This will be used in a custom plugin. (The plugin adds a hidden ...
0
votes
0answers
6 views

Refund in Woocommerce payment integration: WP_Error error not working after wp_remote_post [closed]

I'm trying to implement Refund in woocommerce with third party API. I'm facing a wired problem. WP_Error working fine if i use it before wp_remote_post. But not after it. For example. Below Error ...
0
votes
0answers
19 views

Dotenv file in custom plugin

I want to create some hidden settings that only a developer can change. For this purpose, I would like to have a .env file in my wordpress plugin. How do I read the settings from .env file in my ...
0
votes
0answers
13 views

When setting styles to an extended block that was saved as a pattern, it doesn't remove the style that was there

I'm extending the button block, adding extra options such adding theme colors (a color picker) and icons (radio group). This adds class names for each of the options. has-icon, has-icon-{icon}, is-...
0
votes
2answers
52 views

Why would you use esc_attr() on internal functions?

I see a lot of these in premium themes/plugins. #1 - Why would you escape this? It's your own data. For consistency? function prefix_a() { $class_attr = 'a b c'; // Some more code. ...
0
votes
1answer
22 views

How can I avoid conflicts between plugin and theme?

I'm developing a widget for wp elementor as a plugin. Now my widget front view css and the theme front view css are in conflict. Right now as a developer how can I avoid wp plugin front view css and ...
0
votes
1answer
26 views

New jquery and bootstrap breaks plugin

I wrote a plugin based on the w3schools modal box. https://www.w3schools.com/bootstrap/bootstrap_modal.asp However, when I submitted the plugin to the wordpress directory, they said I needed to ...
0
votes
2answers
35 views

Update custom plugin with WP-CLI

I made a custom plugin for inserting staging / production versions of a Google Tag Manager container based on the server's IP address. How do I make it compatible with WP-CLI so it will update when I ...
0
votes
0answers
12 views

Action Scheduler : Re-schedule a failed action [closed]

I’m trying to reschedule a failed action using the hook: action_scheduler_failed_execution. add_action( 'action_scheduler_failed_execution', 'reschedule_failed_action', 10, 3 ); function ...
0
votes
1answer
57 views

How to show the post which checkbox is not selected

I have custom post type and created one custom field checkbox called is_featured. I have to show the post which is the checkbox is selected so I have used the below code and it's working function ...
1
vote
1answer
111 views

Adding rewrite rule dynamically

I'm trying to dynamically add a rewrite rule that allows one to access any page under an alternate permalink structure of my choosing. So for example, if the alternate permalink structure includes the ...
0
votes
1answer
16 views

Conditional delete metadata does not works

I would like to remove some metadata if I save post with another metadata with custom post type in my plugin.. I tried to use init hook and iterate array from get_posts function but it doesn't work ...
0
votes
0answers
18 views

Products are not displayed in the category to which they are assigned

I'm developing a plugin and apparently it made all the products disappear from its category. I'm not sure what could have caused the error, since the plugin updates price based on a formula. I share a ...
0
votes
0answers
112 views

How to show comments from different Plugins to same post type?

I have two different comments, but both are related to the same post type. The first comments in this way: <?php if (isset($_POST['submit_tickets'])){ $tickets_reply = $_POST['...
1
vote
1answer
33 views

How to convert this cURL to wp_remote_get?

I want to convert curl to wp_remote_get. $url = 'https://accounts.google.com/o/oauth2/token'; $curl_post = 'client_id=' . $client_id . '&redirect_uri=' . $redirect_uri . '&...
0
votes
1answer
32 views

How to create a custom wordpress plugin

I'm learning plugin development and need to create a plugin that contains: Add menu item and page in Admin Panel of WordPress on that page, let us add text messages using a form having a text area ...
0
votes
1answer
27 views

Action / Hook when a new plugin is added

Is there an action hook when a new plugin is installed? I want to hook into the moment when a new plugin was put into the /wp-content/plugins folder. So really just adding the plugin (either via ...
0
votes
0answers
34 views

wordpress full site editing problem when extending core blocks

Hi i am extending the heading block using the filter hooks functions. so i am using the "blocks.registerBlockType" to add additional attributes. i am using the "editor.BlockEdit" ...
0
votes
0answers
36 views

How to get the custom field value using SQL query

I am using the WordPress and I have created a custom post type. Also, I have added the custom field for each custom post. Now I have to fetch the data from the database and I tried the below query ...
0
votes
0answers
15 views

Proper way to do a page view count on a page?

Is there a way to do this? I created a Blog widgets that adds a new custom post called CustomBlogPost, and I don't see a way to do a page count aside creating a new widget and then creating a new ...
0
votes
1answer
57 views

How to get custom post_author?

I have a post type that inserts email as a post. I also created users according to those emails. This is how I added my post type. $post_array = array( 'post_content' => $mail['...
0
votes
0answers
14 views

Catching a GET parameter from the URL and save it in the user meta when a user registers

I am trying to catch a GET parameter from the URL and update the user meta when a user registers. Currently, the approach I am using is: Call a function that runs in the plugin constructor, which ...
0
votes
1answer
22 views

How to check if `comment_meta` exists before inserting the comment?

I am inserting comments via wp_insert_comment and while doing so I am adding email replies only. Now, I want to check if the comment is already present or not before inserting and if does exist do not ...
1
vote
1answer
21 views

How to correctly detect accessing wp-content/uploads?

Not sure if this is a stupid question or not; however, I've been trying to detect when a user accesses a PDF. I want to be able to know how often a user is accessing specific PDF files. I have been ...
0
votes
1answer
44 views

Call to "admin_notices" hook from a static method

Trying to call "admin_notices" hook from a static function. Getting no output. While normal calling to the same hook is working. use Awraq\Init; use Awraq\Notice; /** * Initialize the ...
0
votes
2answers
44 views

How to get the `comment_post_ID`?

I have extracted the reply emails. The original emails are saved as CPT and work as Tickets in my plugin. I want the reply email to go as a comment to the original email. for($j = 1; $j <= $total; ...
2
votes
1answer
157 views

Define a function outside a class and call the function using action or filter hook

Hi Currently i am developing a sub plugin for my own main plugin. Please see the main plugin code below <?php class MyClass { function __construct() { function test1() { ...
0
votes
1answer
17 views

How to Create custom block for displaying information in content section which act like shortcode

I wanted to Display one block which act like shortcode in front and plugin in background. For Example <div class="one-fourth fl glousp-box"> <p class="figure">5000+</...
0
votes
0answers
23 views

apply_filters() and call_user_func() to define and call a function outside a class

Hi Please see the following code of my class class MyClass { function __construct() { $this->autoload_function(); } function autoload_function(){ $my_array=...
0
votes
0answers
28 views

WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit

I'm trying to display a WP_List_table inside a metabox. The metabox is for questions which are from assessment_question custom post type.The metabox is being displayed on an other custom post type '...
0
votes
1answer
17 views

specific rows style for in custom list table using WP_List_Table

I am building a custom WordPress plugin where I create a custom list table for entities in a custom database table, extending the WP_List_Table class. Everything works as expected but I want to style ...
0
votes
0answers
15 views

Showing results from json-string in Wordpress search results page

We're using a service called "Pandosearch" which indexes your website and provides a json-string with results after a call to the service. Example call: When you search for "pandosearch&...
0
votes
0answers
27 views

Can someone explain what's the use of parse request function in WordPress?

What's the meaning of "Parses the request to find the correct WordPress query" in plain Englush? Reference: https://developer.wordpress.org/reference/classes/wp/parse_request/ I encountered ...
0
votes
1answer
30 views

Invalid hook call on save, not edit when using swiper slider

I have installed swiper slider (react version) and created a custom block. When I add the block in the backend it works swimmingly and I can swipe just fine. But when I save and view in the frontend ...

1
2 3 4 5
124