Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter(
'jet-form-builder/stripe/payment-methods',
function ($methods) {
$filtered_methods = array_diff($methods, array('card'));
return array('ideal');
},
10
);
@LaxusCroco
LaxusCroco / jet-blog-modify.php
Created March 11, 2024 09:45
Smart Posts List widget for JetBlog - increase the Featured Post Title Max Length, Title Max Length, and Rows Number
<?php
add_action( 'elementor/element/jet-blog-smart-listing/section_general/before_section_end', 'update_smart_post_list_settings', 10, 2 );
function update_smart_post_list_settings( $widget = null, $args = array() ) {
$widget->update_control(
'featured_title_length',
array(
'max' => 50,
<?php
add_filter( 'jet-booking/ical/import/node', function( $import_node, $node, $calendar_object ) {
$import_node['check_out_date'] = $import_node['check_out_date'] + 86400;
return $import_node;
}, 0, 3 );
<?php
add_filter( 'jet-form-builder/render/media-field/attributes', function( $attrs ) {
if ( false === strpos( $attrs['class'], 'capture-only' ) ) {
return $attrs;
}
$attrs['capture'] = 'environment';
<?php
//add custom callback to calculate the percentage between two fields//
add_filter( 'jet-engine-calculated-callback/config', function( $callbacks = array() ) {
$callbacks['calculate_percent_callback'] = function( $field_value, $fields ) {
$additional_field = jet_engine()->listings->data->get_meta( $fields );
<?php
add_filter( 'jet-form-builder/content-filters', function( $filters ) {
class Separate_With_Spaces_JFB_Filter extends \Jet_Form_Builder\Classes\Filters\Base_Filter {
public function get_id(): string {
return 'separate_with_spaces';
}
jQuery( document ).ready( function( $ ) {
$(window).on( 'jet-popup-open-trigger', function( event ) {
let id = event.popupData.postId ?? '',
slider = $(`#${event.popupData.popupId ?? ''} .gallery-list .jet-listing-grid__items`);
if ( ! slider.length ) {
return;
}
form.is-loading:before,
form.is-loading::after {
position: fixed;
top: 50%;
left: 50%;
<?php
add_filter(
'jet-form-builder/preset-sanitize',
function ( $sanitize, \Jet_Form_Builder\Presets\Sources\Base_Source $source ) {
if ( jet_fb_live()->form_id == 258314 ) {
return true;
}
<?php
add_filter( 'jet-engine/maps-listings/autocomplete-url-args/google', function( $args ){
$args['components'] = 'country:fr';
return $args;
} );