add_filter( 'generateblocks_css_print_method', 'generateblocks_set_css_print_method' );
/**
* Set our CSS print method.
*
* @param string $method Existing method.
*/
function generateblocks_set_css_print_method( $method ) {
$method = generateblocks_get_option( 'css_print_method' );
if ( is_single() ) {
$method = 'inline';
}
return $method;
}
Description
Set the CSS Print Method
By default the Single Post method is set to inline
to avoid writing lots of post CSS files.
Params
$method
set the method
Basic Example #1
Set the single post to print an external file
add_filter( 'generateblocks_css_print_method', function( $method ) {
$saved_method = generateblocks_get_option( 'css_print_method' );
if ( is_single() ) {
$method = $saved_method;
}
return $method;
}, 20 );