Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created October 20, 2022 08:50
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/0bc7701c705fb5abfef9c9f6208080be to your computer and use it in GitHub Desktop.
Save andreiglingeanu/0bc7701c705fb5abfef9c9f6208080be to your computer and use it in GitHub Desktop.
<?php
add_action('blocksy:pro:content-blocks:pre-output', function ($id) {
if (is_admin() || ! $id) {
return;
}
$maybe_file_path = wp_upload_dir()[
'basedir'
] . '/cwicly/css/cc-post-' . $id . '.css';
if (file_exists($maybe_file_path)) {
wp_enqueue_style(
'cc-post-' . $id . '',
wp_upload_dir()['baseurl'] . '/cwicly/css/cc-post-' . $id . '.css',
[],
filemtime($maybe_file_path)
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment