Created
December 20, 2021 17:04
-
-
Save mwangepatrick/5eaf1be6e85f48fb1267747993faa158 to your computer and use it in GitHub Desktop.
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($){ | |
/** | |
* initializeBlock | |
* | |
* Adds custom JavaScript to the block HTML. | |
* | |
* @date 15/4/19 | |
* @since 1.0.0 | |
* | |
* @param object $block The block jQuery element. | |
* @param object attributes The block attributes (only available when editing). | |
* @return void | |
*/ | |
var initializeBlock = function( $block ) { | |
} | |
// Initialize each block on page load (front end). | |
$(document).ready(function(){ | |
$('.testimonial').each(function(){ | |
initializeBlock( $(this) ); | |
}); | |
}); | |
// Initialize dynamic block preview (editor). | |
if( window.acf ) { | |
window.acf.addAction( 'render_block_preview/type=testimonial', initializeBlock ); | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment