This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://gist.github.com/Crocoblock/3f33588881a09c0dd275f11aa00c973f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param \Jet_Form_Builder\Actions\Types\Base $action_instance | |
* @param \Jet_Form_Builder\Actions\Action_Handler $action_handler | |
*/ | |
$onInsertPost = function ( $action_instance, $action_handler ) { | |
$inserted_id = $action_handler->response_data['inserted_post_id']; | |
$url = get_permalink( $inserted_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$on_insert_port = function ( $settings, $notification ) { | |
if ( 'post' !== $settings['post_type'] ) { | |
return; | |
} | |
/** | |
* To get/set the entered data from the form use $notification->data | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Jet_Form_Builder\Exceptions\Action_Exception; | |
add_action( 'jet-form-builder/custom-action/test_action', function ( $request, $handler ) { | |
if ( empty( $request['age'] ) ) { | |
/** | |
* You can use one of the default statuses | |
* 'success' => 'Form successfully submitted.', | |
* 'failed' => 'There was an error trying to submit form. Please try again later.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is an example of working with a hook | |
* that is triggered when an item is added to the cart via the addon | |
* @link https://jetformbuilder.com/addons/woocommerce-cart-checkout-action/ | |
* | |
* Works with both JetFormBuilder and JetEngine Forms | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Jet_Form_Builder\Actions\Action_Handler; | |
use Jet_Form_Builder\Exceptions\Action_Exception; | |
/** | |
* add-product - the name of your custom hook | |
*/ | |
add_action( 'jet-form-builder/custom-action/add-product', function ( $request, Action_Handler $handler ) { | |
if ( ! function_exists( 'wc_get_product' ) ) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function jfb_add_paypal_webhooks( array $webhooks ) { | |
require_once 'jfb-paypal-cancel-subscription-webhook.php'; | |
$webhooks[] = new JFB_Paypal_Cancel_Subscription_Webhook(); | |
return $webhooks; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hands up! If you are using version 1.1.0 or higher. You won't need the code below. Just use new events | |
* @link https://user-images.githubusercontent.com/46720998/190651417-bba9c801-812c-4d8e-bbf4-d32075bc4fd7.png | |
* | |
* | |
* | |
* This gist is an extended version of this gist. | |
* @link https://gist.github.com/girafffee/040ff0ec2f148cd429d4a91cc7006c50#file-jfb-add-paypal-webhooks-php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Works in JetFormBuilder >= 2.1.0 | |
*/ | |
add_filter( | |
'jet-form-builder/send-email/template-repeater', | |
/** | |
* Verbose repeater items array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'jet-form-builder/forms/options-generators', | |
'add_custom_jfb_generator' | |
); | |
function add_custom_jfb_generator( array $generators ) { | |
$generators[] = new class extends \Jet_Form_Builder\Generators\Base { |
OlderNewer