| 1 |
<?php |
| 2 |
|
| 3 |
namespace QuadLayers\QuadMenu; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
die( '-1' ); |
| 7 |
} |
| 8 |
|
| 9 |
use QuadLayers\QuadMenu\Redux_Legacy; |
| 10 |
|
| 11 |
/** |
| 12 |
* Icons Class ex QuadMenu_Icons |
| 13 |
*/ |
| 14 |
class Icons extends Redux_Legacy { |
| 15 |
|
| 16 |
private static $instance; |
| 17 |
|
| 18 |
public $args = array(); |
| 19 |
public $sections = array(); |
| 20 |
public $theme; |
| 21 |
public $ReduxFramework; |
| 22 |
|
| 23 |
public function __construct() { |
| 24 |
|
| 25 |
add_action( 'redux/options/' . QUADMENU_DB_OPTIONS . '/settings/change', array( $this, 'icons' ), 10, 2 ); |
| 26 |
} |
| 27 |
|
| 28 |
static function icons( $options = false, $changed = false ) { |
| 29 |
|
| 30 |
// if settings change, take new values from redux update |
| 31 |
if ( empty( $changed['styles_icons'] ) ) { |
| 32 |
return; |
| 33 |
} |
| 34 |
|
| 35 |
Redux_Legacy::do_reload( true ); |
| 36 |
|
| 37 |
Redux_Legacy::add_notification( 'blue', sprintf( esc_html__( 'Theme icons have been changed. Your options panel will be reloaded. %s.', 'quadmenu' ), esc_html__( 'Please wait', 'quadmenu' ) ) ); |
| 38 |
} |
| 39 |
|
| 40 |
public static function instance() { |
| 41 |
if ( ! isset( self::$instance ) ) { |
| 42 |
self::$instance = new self(); |
| 43 |
} |
| 44 |
return self::$instance; |
| 45 |
} |
| 46 |
} |
| 47 |
|