This file contains hidden or 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
if ( is_admin() && function_exists( 'crocoblock_wizard' ) ) { | |
crocoblock_wizard()->settings->register_external_config( array( | |
'import' => array( | |
'chunk_size' => 10, | |
'regenerate_chunk_size' => 1, | |
'allow_types' => false, | |
), | |
) ); | |
} |
This file contains hidden or 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
(function($) { | |
'use strict'; | |
$( document ).ready(function() { | |
$( '.jet-ajax-search__form' ).on( 'submit', function( event ) { | |
event.preventDefault(); | |
var $form = $( this ), | |
action = $form.attr( 'action' ), | |
$inputs = $form.find( '[name]' ), |
This file contains hidden or 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_filter( 'jet-search/ajax-search/categories-select/args', function( $args ) { | |
$args['depth'] = 1; | |
return $args; | |
} ); |
This file contains hidden or 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/forms/booking/notification/insert_post', function( $notification, $manager ) { | |
$form_id = absint( $manager->form ); | |
if ( 1853 !== $form_id ) { // Need to change the Form ID | |
return; | |
} | |
$media_key = 'field_media2'; // Need to change the Media Field Name |
This file contains hidden or 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_filter( 'upload_mimes', '__add_z_zip_mime_type' ); | |
function __add_z_zip_mime_type( $mimes ) { | |
$mimes['xzip'] = 'application/x-zip-compressed'; | |
return $mimes; | |
} |
This file contains hidden or 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
function update_table() { | |
global $wpdb; | |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); | |
$wpdb->query( "ALTER TABLE {$wpdb->prefix}jet_post_types MODIFY COLUMN `meta_fields` longtext" ); | |
} | |
update_table(); |
This file contains hidden or 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
function __prefix__add_relation_meta( $post_id, $meta_key, $related_posts = array() ) { | |
$relation = jet_engine()->relations->get_relation_info( $meta_key ); | |
if ( ! $relation ) { | |
return; | |
} | |
if ( empty( $related_posts ) ) { | |
jet_engine()->relations->data->delete_all_related_meta( $meta_key, $post_id ); |
This file contains hidden or 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_filter( 'jet-engine/listings/filters-list', function( $list ) { | |
$list['term_title_by_id'] = array( | |
'cb' => '__get_term_title_by_id', | |
'args' => false, | |
); | |
return $list; | |
} ); | |
function __get_term_title_by_id( $id ) { |
This file contains hidden or 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( 'gform_pre_submission', '__your_prefix__pre_submission_handler' ); | |
function __your_prefix__pre_submission_handler( $form ) { | |
$media_key = 'media_key'; // Need change on your media key | |
$_POST[ $media_key ] = __your_prefix__get_image_id_by_url( $_POST[ $media_key ] ); | |
} | |
This file contains hidden or 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
function rus_to_latin ( str ) { | |
var ru = { | |
'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', | |
'е': 'e', 'ё': 'e', 'ж': 'j', 'з': 'z', 'и': 'i', | |
'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', | |
'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', | |
'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch', 'ш': 'sh', | |
'щ': 'shch', 'ы': 'y', 'э': 'e', 'ю': 'u', 'я': 'ya' | |
}, n_str = []; |