|
16 | 16 | } |
17 | 17 |
|
18 | 18 | /** |
19 | | - * Register Panel Fieds Against Panel ID |
20 | | - * -------------------------------------- |
| 19 | + * Register Settings Panel |
| 20 | + * -------------------------- |
21 | 21 | */ |
22 | | -$core_settings = array( |
23 | | - 'ppom_general_section1' => array( |
24 | | - 'type' => 'section', |
25 | | - 'title' => __( 'Basic Settings', 'woocommerce-product-addon' ), |
26 | | - ), |
27 | | - 'ppom_disable_bootstrap' => array( |
28 | | - 'type' => 'checkbox', |
29 | | - 'title' => __( 'Disable Bootstrap', 'woocommerce-product-addon' ), |
30 | | - 'desc' => __( 'Bootstrap JS is loaded from a CDN by default. You can disable it if your site is already loading it.', 'woocommerce-product-addon' ), |
31 | | - 'label' => __( 'Yes', 'woocommerce-product-addon' ), |
32 | | - ), |
33 | | - 'ppom_enable_legacy_inputs_rendering' => array( |
34 | | - 'type' => 'checkbox', |
35 | | - 'title' => __( 'Legacy Inputs Rendering', 'woocommerce-product-addon' ), |
36 | | - 'desc' => __( 'PPOM Version 22.0 is a major update. If any issues occur, you can revert to the previous version using this option.', 'woocommerce-product-addon' ), |
37 | | - ), |
38 | | - 'ppom_new_conditions' => array( |
39 | | - 'type' => 'checkbox', |
40 | | - 'title' => __( 'Legacy Conditions Script', 'woocommerce-product-addon' ), |
41 | | - 'desc' => __( 'If you found any issue in conditions you may enable this option.', 'woocommerce-product-addon' ), |
42 | | - ), |
43 | | - 'ppom_legacy_price' => array( |
44 | | - 'type' => 'checkbox', |
45 | | - 'title' => __( 'Enable Legacy Price Calculations', 'woocommerce-product-addon' ), |
46 | | - 'desc' => __( 'Enable this option to use the legacy method for price calculations.', 'woocommerce-product-addon' ), |
47 | | - ), |
48 | | - 'ppom_permission_mfields' => array( |
49 | | - 'type' => 'select', |
50 | | - 'title' => __( 'PPOM Permissions', 'woocommerce-product-addon' ), |
51 | | - 'desc' => __( 'You can set permissions here to allow different roles to manage PPOM fields.', 'woocommerce-product-addon' ), |
52 | | - 'default' => 'administrator', |
53 | | - 'placeholder' => __( 'choose role', 'woocommerce-product-addon' ), |
54 | | - 'options' => ppom_get_all_editable_roles(), |
55 | | - 'style' => 'multiselect', |
56 | | - ), |
57 | | - 'ppom_restricted_file_type' => array( |
58 | | - 'type' => 'text', |
59 | | - 'title' => __( 'Restricted File Types', 'woocommerce-product-addon' ), |
60 | | - 'desc' => __( 'Specify the file types that are restricted from being uploaded in this section.', 'woocommerce-product-addon' ), |
61 | | - 'default' => __( 'php,php4,php5,php6,php7,phtml,exe,shtml', 'woocommerce-product-addon' ), |
62 | | - ), |
63 | | - 'ppom_general_section2' => array( |
64 | | - 'type' => 'section', |
65 | | - 'title' => __( 'Label Settings', 'woocommerce-product-addon' ), |
66 | | - ), |
67 | | - 'ppom_label_option_total' => array( |
68 | | - 'type' => 'text', |
69 | | - 'title' => __( 'Option Total Label Inside Price Table', 'woocommerce-product-addon' ), |
70 | | - 'default' => __( 'Option Total', 'woocommerce-product-addon' ), |
71 | | - ), |
72 | | - 'ppom_label_product_price' => array( |
73 | | - 'type' => 'text', |
74 | | - 'title' => __( 'Product Price Label inside Price Table', 'woocommerce-product-addon' ), |
75 | | - 'default' => __( 'Product Price', 'woocommerce-product-addon' ), |
76 | | - ), |
77 | | - 'ppom_label_total' => array( |
78 | | - 'type' => 'text', |
79 | | - 'title' => __( 'Total Label inside Price Table', 'woocommerce-product-addon' ), |
80 | | - 'default' => __( 'Total', 'woocommerce-product-addon' ), |
81 | | - ), |
82 | | - 'ppom_label_total_discount' => array( |
83 | | - 'type' => 'text', |
84 | | - 'title' => __( 'Total Discount Label Inside Price Table', 'woocommerce-product-addon' ), |
85 | | - 'default' => __( 'Total Discount', 'woocommerce-product-addon' ), |
86 | | - ), |
87 | | - 'ppom_label_option_total_suffex' => array( |
88 | | - 'type' => 'text', |
89 | | - 'title' => __( 'Option Total Suffix', 'woocommerce-product-addon' ), |
90 | | - 'desc' => __( 'Specify the label to display tax or VAT information, such as \'VAT Included\' or \'Tax Applied,\' inside the price table.', 'woocommerce-product-addon' ), |
91 | | - ), |
92 | | -); |
93 | 22 |
|
94 | | -/** |
95 | | - * Register Panel Against Tab ID |
96 | | - * ------------------------------- |
97 | | - */ |
98 | | -$panel_meta = array( |
99 | | - 'ppom_admin_core_settings' => array( |
100 | | - 'id' => 'ppom_admin_core_settings', |
101 | | - 'title' => 'General Settings', |
102 | | - 'desc' => '', |
103 | | - 'is_sabpanel' => true, |
104 | | - 'active' => 'yes', |
105 | | - ), |
106 | | -); |
| 23 | +function ppom_load_free_options() { |
| 24 | + |
| 25 | + /** |
| 26 | + * Register Panel Fieds Against Panel ID |
| 27 | + * -------------------------------------- |
| 28 | + */ |
| 29 | + $core_settings = array( |
| 30 | + 'ppom_general_section1' => array( |
| 31 | + 'type' => 'section', |
| 32 | + 'title' => __( 'Basic Settings', 'woocommerce-product-addon' ), |
| 33 | + ), |
| 34 | + 'ppom_disable_bootstrap' => array( |
| 35 | + 'type' => 'checkbox', |
| 36 | + 'title' => __( 'Disable Bootstrap', 'woocommerce-product-addon' ), |
| 37 | + 'desc' => __( 'Bootstrap JS is loaded from a CDN by default. You can disable it if your site is already loading it.', 'woocommerce-product-addon' ), |
| 38 | + 'label' => __( 'Yes', 'woocommerce-product-addon' ), |
| 39 | + ), |
| 40 | + 'ppom_enable_legacy_inputs_rendering' => array( |
| 41 | + 'type' => 'checkbox', |
| 42 | + 'title' => __( 'Legacy Inputs Rendering', 'woocommerce-product-addon' ), |
| 43 | + 'desc' => __( 'PPOM Version 22.0 is a major update. If any issues occur, you can revert to the previous version using this option.', 'woocommerce-product-addon' ), |
| 44 | + ), |
| 45 | + 'ppom_new_conditions' => array( |
| 46 | + 'type' => 'checkbox', |
| 47 | + 'title' => __( 'Legacy Conditions Script', 'woocommerce-product-addon' ), |
| 48 | + 'desc' => __( 'If you found any issue in conditions you may enable this option.', 'woocommerce-product-addon' ), |
| 49 | + ), |
| 50 | + 'ppom_legacy_price' => array( |
| 51 | + 'type' => 'checkbox', |
| 52 | + 'title' => __( 'Enable Legacy Price Calculations', 'woocommerce-product-addon' ), |
| 53 | + 'desc' => __( 'Enable this option to use the legacy method for price calculations.', 'woocommerce-product-addon' ), |
| 54 | + ), |
| 55 | + 'ppom_permission_mfields' => array( |
| 56 | + 'type' => 'select', |
| 57 | + 'title' => __( 'PPOM Permissions', 'woocommerce-product-addon' ), |
| 58 | + 'desc' => __( 'You can set permissions here to allow different roles to manage PPOM fields.', 'woocommerce-product-addon' ), |
| 59 | + 'default' => 'administrator', |
| 60 | + 'placeholder' => __( 'choose role', 'woocommerce-product-addon' ), |
| 61 | + 'options' => ppom_get_all_editable_roles(), |
| 62 | + 'style' => 'multiselect', |
| 63 | + ), |
| 64 | + 'ppom_restricted_file_type' => array( |
| 65 | + 'type' => 'text', |
| 66 | + 'title' => __( 'Restricted File Types', 'woocommerce-product-addon' ), |
| 67 | + 'desc' => __( 'Specify the file types that are restricted from being uploaded in this section.', 'woocommerce-product-addon' ), |
| 68 | + 'default' => __( 'php,php4,php5,php6,php7,phtml,exe,shtml', 'woocommerce-product-addon' ), |
| 69 | + ), |
| 70 | + 'ppom_general_section2' => array( |
| 71 | + 'type' => 'section', |
| 72 | + 'title' => __( 'Label Settings', 'woocommerce-product-addon' ), |
| 73 | + ), |
| 74 | + 'ppom_label_option_total' => array( |
| 75 | + 'type' => 'text', |
| 76 | + 'title' => __( 'Option Total Label Inside Price Table', 'woocommerce-product-addon' ), |
| 77 | + 'default' => __( 'Option Total', 'woocommerce-product-addon' ), |
| 78 | + ), |
| 79 | + 'ppom_label_product_price' => array( |
| 80 | + 'type' => 'text', |
| 81 | + 'title' => __( 'Product Price Label inside Price Table', 'woocommerce-product-addon' ), |
| 82 | + 'default' => __( 'Product Price', 'woocommerce-product-addon' ), |
| 83 | + ), |
| 84 | + 'ppom_label_total' => array( |
| 85 | + 'type' => 'text', |
| 86 | + 'title' => __( 'Total Label inside Price Table', 'woocommerce-product-addon' ), |
| 87 | + 'default' => __( 'Total', 'woocommerce-product-addon' ), |
| 88 | + ), |
| 89 | + 'ppom_label_total_discount' => array( |
| 90 | + 'type' => 'text', |
| 91 | + 'title' => __( 'Total Discount Label Inside Price Table', 'woocommerce-product-addon' ), |
| 92 | + 'default' => __( 'Total Discount', 'woocommerce-product-addon' ), |
| 93 | + ), |
| 94 | + 'ppom_label_option_total_suffex' => array( |
| 95 | + 'type' => 'text', |
| 96 | + 'title' => __( 'Option Total Suffix', 'woocommerce-product-addon' ), |
| 97 | + 'desc' => __( 'Specify the label to display tax or VAT information, such as \'VAT Included\' or \'Tax Applied,\' inside the price table.', 'woocommerce-product-addon' ), |
| 98 | + ), |
| 99 | + ); |
107 | 100 |
|
| 101 | + /** |
| 102 | + * Register Main Tabs |
| 103 | + * -------------------------- |
| 104 | + */ |
| 105 | + $register_tabs = array( |
| 106 | + 'ppom_general_tab' => array( |
| 107 | + 'tab_id' => 'ppom_general_tab', |
| 108 | + 'title' => 'PPOM', |
| 109 | + 'icon' => '', |
| 110 | + 'classes' => array( 'active' ), |
| 111 | + 'enable' => true, |
| 112 | + ), |
| 113 | + ); |
108 | 114 |
|
109 | | -/** |
110 | | - * Register Main Tabs |
111 | | - * -------------------------- |
112 | | - */ |
113 | | -$register_tabs = array( |
114 | | - 'ppom_general_tab' => array( |
115 | | - 'tab_id' => 'ppom_general_tab', |
116 | | - 'title' => 'PPOM', |
117 | | - 'icon' => '', |
118 | | - 'classes' => array( 'active' ), |
119 | | - 'enable' => true, |
120 | | - ), |
121 | | -); |
| 115 | + /** |
| 116 | + * Register Panel Against Tab ID |
| 117 | + * ------------------------------- |
| 118 | + */ |
| 119 | + $panel_meta = array( |
| 120 | + 'ppom_admin_core_settings' => array( |
| 121 | + 'id' => 'ppom_admin_core_settings', |
| 122 | + 'title' => 'General Settings', |
| 123 | + 'desc' => '', |
| 124 | + 'is_sabpanel' => true, |
| 125 | + 'active' => 'yes', |
| 126 | + ), |
| 127 | + ); |
122 | 128 |
|
| 129 | + PPOMSETTINGS()->register_tabs( $register_tabs )->register_panel( 'ppom_general_tab', $panel_meta ); |
| 130 | + PPOMSETTINGS()->register_setting( 'ppom_admin_core_settings', $core_settings ); |
| 131 | +} |
| 132 | +add_action( 'init', 'ppom_load_free_options' ); |
123 | 133 |
|
124 | | -/** |
125 | | - * Register Settings Panel |
126 | | - * -------------------------- |
127 | | - */ |
128 | | -PPOMSETTINGS()->register_tabs( $register_tabs )->register_panel( 'ppom_general_tab', $panel_meta ); |
129 | | -PPOMSETTINGS()->register_setting( 'ppom_admin_core_settings', $core_settings ); |
130 | 134 | function ppom_load_pro_options() { |
131 | 135 | $pro_settings = array( |
132 | 136 | 'ppom_pro_basics' => array( |
|
0 commit comments