Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created October 12, 2021 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreiglingeanu/fe4deb1171e87d566a3e161dab9ab9ff to your computer and use it in GitHub Desktop.
Save andreiglingeanu/fe4deb1171e87d566a3e161dab9ab9ff to your computer and use it in GitHub Desktop.
<?php
add_action('blocksy:pro:content-blocks:pre-output', function ($id) {
$upload_dir = wp_upload_dir();
if (file_exists($upload_dir['basedir'] . '/eb-style/eb-style-' . $id . '.min.css')) {
wp_enqueue_style(
'eb-block-style-' . $id,
$upload_dir['baseurl'] . '/eb-style/eb-style-' . $id . '.min.css',
[],
substr(md5(microtime(true)), 0, 10)
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment