//remove sidebar from section templates in elementor editor
function remove_sidebar_elementor_section_templates( $layout ) {
if ( is_singular( 'elementor_library' ) ) {
$template_type = get_post_meta( get_the_ID(), '_elementor_template_type', true );
if ( 'section' === $template_type ) {
return 'no-sidebar';
}
}
return $layout;
}
add_filter( 'generate_sidebar_layout', 'remove_sidebar_elementor_section_templates' );
elementor
elementor flip card for masonry
enlarges elementor flip card background for masonry layouts.
(() => {
const elementorFlipBoxEls = document.querySelectorAll('.elementor-flip-box')
if (!elementorFlipBoxEls) {
return;
}
// match elementor flip card height setting
const outerHeight = 120;
elementorFlipBoxEls.forEach(flipBox => {
const imgEl = flipBox.querySelector('.elementor-flip-box__image img');
if (!imgEl) {
return;
}
flipBox.style.height = (imgEl.clientHeight + outerHeight) + 'px';
});
})();
block eric jones form spam
// Validate if Email field is spam from ERIC JONES
add_action( 'elementor_pro/forms/validation/email', function( $field, $record, $ajax_handler ) {
// Looking if email found in spam array, you can add to the array
$spamemails = array("ericjonesonline@outlook.com", "eric@talkwithwebvisitor.com", "eric.jones.z.mail@gmail.com", "eric@talkwithcustomer.com");
if ( in_array( $field['value'] , $spamemails) ) {
$ajax_handler->add_error( $field['id'], 'אנחנו לא אוהבים ספאם, נסו מייל אחר' );
}
}, 10, 3 );