## Changing form action based on selected value

Question
I am making a form using elementor pro. Is it possible to take an action following an user's choice? p.e. Question "Which Item do you prefer?" radiobutton1 - first item radiobutton2 - second item radiobutton3 - third item if the user selects radiobutton1 ...
0
4 weeks 0 Answers 26 views

## WordPress How do I pass a variable from one add_action to another?

Question
I'm trying to add a custom field on the checkout form if a certain product category is in the basket and then on submission, check that field has been completed and add the result to the order details. I have the ...
0
4 weeks 0 Answers 21 views

Question
I'd like to share a variable between two add_actions. Currently I'm trying to use a global. However it doesn't work. This simple example below illustrates the problem. In this example, test_before_send_mail() runs before test_get_form_post_callback(). $test = '123'; add_action('wpcf7_before_send_mail', 'test_before_send_mail'); function test_before_send_mail() { ... 0 4 weeks 0 Answers 21 views ## How to prevent action in ajax request, when in admin side? Question I have a plugin that hides certain posts in the frontend. For this to be consistent, I need posts to also be hidden in searches and AJAX searches (needs to work with any theme and search). To make this work with ... 0 4 weeks 0 Answers 17 views ## Add_action increment value by 2 instead of 1 Question I am making a counter where I can count amount of posts ever posted on my blog and save the value in a option. I have created a function that gets executed every time I publish new post, but the issue ... 0 1 month 0 Answers 23 views ## What is the earliest Hook a Script can use? Question At present, I am disabling Right Click through the use of the following code: <?php // Disable Right Click function disable_right_click() { ?> <script> jQuery(document).ready(function(){ jQuery(document).bind("contextmenu",function(e){ return false; }); }); </script> <?php } add_action('wp_head', 'disable_right_click'); add_action('admin_head', 'disable_right_click'); ?> The only problem ... 0 1 month 0 Answers 23 views ## How do I trigger WP CLI DB export using a PHP function? Question I want to use WP-CLI to export a database - using wp db export - to create backups. I also need to use cron to control the backup schedule. WP-CLI is installed on my managed host, and I can use ... 0 1 month 0 Answers 26 views ## How do I use WP-CLI as an “add_action” function? Question I want to use WP-CLI to export a database - using wp db export - to create backups. I also need to use cron to control the backup schedule. WP-CLI is installed on my managed host, and I can use ... 0 1 month 0 Answers 25 views ## Send Mail when coupon code is applied and order is successful Question i tried with code below to send mail when coupon code is applied, though my requirement says when the order is successful and coupon code is applied it should send mail. add_action( 'woocommerce_applied_coupon', 'custom_email_on_applied_coupon', 10, 1 ); function custom_email_on_applied_coupon($coupon_code ){ if( ...
0
1 month 0 Answers 22 views