/** * Grab all shortcode styles for current page into separate tag and iclude it in footer * or directly print style if grabbing logic not defined * * @since 1.0.7 * @param string $style CSS styles set. * @return void|bool */ public static function print_styles($style = null) { if (!$style) { return false; } if (!function_exists('cherry_add_generated_style')) { printf('<style scoped>%s</style>', $style); return true; } cherry_add_generated_style($style); }
/** * Grab all shortcode styles for current page into separate tag and iclude it in footer * or directly print style if grabbing logic not defined * * @since 1.0.7 * @since 1.0.7.1 Added a filter `cherry_shortcodes_use_generated_style`. * @param string $style CSS styles set. * @return string */ public static function print_styles($style = null) { if (!$style) { return ''; } /** * Filter a flag for using generated style feature. * * @since 1.0.7.1 * @param bool $use_generated_style */ $use_generated_style = apply_filters('cherry_shortcodes_use_generated_style', true); if ($use_generated_style && function_exists('cherry_add_generated_style')) { cherry_add_generated_style($style); return ''; } return sprintf('<style scoped>%s</style>', $style); }