PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 3.0.0
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v3.0.0
4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 3.12.1 All 134 releases
optimole-wp / inc / asset_properties / minify.php

minify.php in Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization 3.0.0, at inc/asset_properties/minify.php

61 lines 943 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class Optml_Minify
5 */
6 class Optml_Minify extends Optml_Property_Type {
7
8 /**
9 * Default minify value.
10 *
11 * @var string Minify value.
12 */
13 public static $default_minify = 0;
14 /**
15 * Minify Property.
16 *
17 * @var mixed $minify
18 */
19 private $minify;
20
21 /**
22 * Optml_Minify constructor.
23 *
24 * @param mixed $value Default value.
25 */
26 public function __construct( $value = '' ) {
27 if ( empty( $value ) ) {
28 $value = self::$default_minify;
29 }
30 $this->set( $value );
31 }
32
33 /**
34 * Set property value.
35 *
36 * @param mixed $value Value to set.
37 */
38 public function set( $value ) {
39 $this->minify = $this->to_bound_integer( $value, 0, 1 );
40
41 }
42
43 /**
44 * Return property value.
45 *
46 * @return mixed
47 */
48 public function get() {
49 return $this->minify;
50 }
51
52 /**
53 * Return minify asset URL formatted string property.
54 *
55 * @return mixed
56 */
57 public function toString() {
58 return sprintf( 'm:%s', $this->minify );
59 }
60 }
61