PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 5.2.0
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v5.2.0
5.5.3 3.1.0 3.2.0 3.2.1 3.3.0 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.6.0 3.7.0 3.8.0 3.8.1 3.8.2 3.8.3 4.0.0 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 All 78 releases
copy-the-code / includes / class-helper.php

class-helper.php in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 5.2.0, at includes/class-helper.php

51 lines 981 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Helper Class
4 *
5 * @package CTC
6 * @since 5.0.0
7 */
8
9 namespace CTC;
10
11 /**
12 * Helper Class
13 *
14 * @since 5.0.0
15 */
16 class Helper {
17
18 /**
19 * Check if the plugin is Pro version
20 *
21 * Uses Freemius or can be filtered by Pro add-on plugin.
22 *
23 * @since 5.0.0
24 * @return bool
25 */
26 public static function is_pro() {
27 /**
28 * Filter to enable Pro features.
29 *
30 * Pro add-on plugin can hook into this to enable Pro features.
31 *
32 * @since 5.0.0
33 * @param bool $is_pro Whether Pro is active. Default false.
34 */
35 return apply_filters( 'ctc/is_pro', function_exists( 'ctc_fs' ) && ctc_fs()->is__premium_only() );
36 }
37
38 /**
39 * Minify CSS: strip comments and collapse whitespace.
40 *
41 * @since 5.0.2
42 * @param string $css Raw CSS.
43 * @return string Minified CSS.
44 */
45 public static function minify_css( $css ) {
46 $css = (string) preg_replace( '/\/\*[\s\S]*?\*\//', '', $css );
47 $css = (string) preg_replace( '/\s+/', ' ', $css );
48 return trim( $css );
49 }
50 }
51