Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created March 11, 2019 14:31
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 Shelob9/03d52cf403a9e01345e61bc8f45a8a24 to your computer and use it in GitHub Desktop.
Save Shelob9/03d52cf403a9e01345e61bc8f45a8a24 to your computer and use it in GitHub Desktop.
Load all CSS for Caldera Forms.
<?php
if ( class_exists( 'Caldera_Forms_Render_Assets' ) && class_exists( 'Caldera_Forms' ) ) {
\Caldera_Forms_Render_Assets::maybe_register();
\Caldera_Forms_Render_Assets::optional_style_includes();
\Caldera_Forms_Render_Assets::enqueue_style('front' );
\Caldera_Forms_Render_Assets::enqueue_style('fields' );
foreach (\Caldera_Forms_Fields::get_all() as $field_type ){
if( !empty( $field_types['styles'])){
foreach($field_types['styles'] as $style){
\Caldera_Forms_Render_Assets::enqueue_style( $style );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment