Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Gutenberg scripts and styles
*
*/
function ea_gutenberg_scripts() {
wp_enqueue_script( 'ea-gutenberg', get_stylesheet_directory_uri() . '/assets/js/gutenberg-min.js', array( 'jquery' ), filemtime( get_stylesheet_directory() . '/assets/js/gutenberg-min.js' ), true );
}
add_action( 'enqueue_block_editor_assets', 'ea_gutenberg_scripts' );
jQuery(function($){
$(window).load(function(){
var field = acf.getField('field_5c194bf2f653d'),
header = $('.editor-post-title__block');
$(header).css('max-width', field.val() + 'px' );
field.on('change', function(e) {
$(header).css('max-width', field.val() + 'px' );
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment