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 | |
/** | |
* Pay attention! | |
* The 'main_cct' part must be replaced with the slug of the CCT from your website. | |
*/ | |
add_action( 'jet-engine/custom-content-types/created-item/main_cct', function ( $item, $item_id, $item_handler ) { | |
jet_form_builder()->form_handler->action_handler->request_data['inserted_cct_id'] = $item_id; | |
}, 10, 3 ); |
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_action( 'jet-engine/register-macros', function(){ | |
class Items_With_Relation extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { | |
return 'items_with_relation'; | |
} |
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 Google Tag Manager code for the <head> tag. | |
*/ | |
function custom_add_gtm_code() { | |
?> | |
<!-- Add your GTM code snippet below this line --> | |
<?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 | |
add_action( | |
'jet-form-builder/media-field/before-upload', | |
/** | |
* @var \Jet_Form_Builder\Request\Fields\Media_Field_Parser $parser | |
*/ | |
function ( $parser ) { | |
$class_name = $parser->get_context()->get_class_name(); |
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 | |
class JSF_Inverse_Meta_Filter { | |
public function __construct() { | |
add_filter( 'jet-smart-filters/query/final-query', array( $this, 'change_query' ) ); | |
} | |
public function change_query( $query ) { | |
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_action( 'jet-engine/register-macros', function(){ | |
class Queried_User_Roles extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { | |
return 'queried_user_roles'; |
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_shortcode( 'get_post_type_name', 'get_post_type_name' ); | |
function get_post_type_name( $args ) { | |
$display = $args['display']; | |
if ( ! $display ) { | |
return 'No data found'; |
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
add_action( 'jet-engine/callbacks/register', function( $callbacks ) { | |
$args = array( | |
'repeater_name' => array( | |
'label' => 'Repeater Field key', | |
'type' => 'text', | |
), | |
'sub_field_name' => array( | |
'label' => 'Sub-field name', | |
'type' => 'text', |
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-engine-calculated-callback/config', function( $callbacks = array() ) { | |
$callbacks['average_value'] = function( $field_value, $additional ) { | |
if ( empty( $additional ) ) { | |
return 'Please set additional meta fields names to calculate'; | |
} |
OlderNewer