PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.2
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / inc / classes / class-merchant-option.php

class-merchant-option.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 2.3.2, at inc/classes/class-merchant-option.php

57 lines 918 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Merchant_Option Class.
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10 if ( ! class_exists( 'Merchant_Option' ) ) {
11
12 class Merchant_Option {
13
14 /**
15 * Option name
16 */
17 public static $option = 'merchant';
18
19 /**
20 * The single class instance.
21 */
22 private static $instance = null;
23
24 /**
25 * Instance.
26 */
27 public static function instance() {
28 if ( is_null( self::$instance ) ) {
29 self::$instance = new self();
30 }
31 return self::$instance;
32 }
33
34 /**
35 * Constructor.
36 */
37 public function __construct() {}
38
39 /**
40 * Get option.
41 */
42 public static function get( $module, $setting, $default_val = null ) {
43
44 $options = get_option( 'merchant', array() );
45
46 $value = $default_val;
47
48 if ( isset( $options[ $module ] ) && isset( $options[ $module ][ $setting ] ) ) {
49 $value = $options[ $module ][ $setting ];
50 }
51
52 return $value;
53 }
54 }
55
56 }
57