| @@ -1,9 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * Wait List Options. | |
| 4 | + * Wait List — Option group definitions. | |
| 5 | 5 | * |
| 6 | + * Pure data file. Returns the option groups array | |
| 7 | + * consumed by init_option_groups(). | |
| 8 | + * | |
| 6 | 9 | * @package Merchant |
| 7 | 10 | */ |
| 8 | 11 | |
| 9 | 12 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -10,9 +13,11 @@ | ||
| 10 | 13 | exit; // Exit if accessed directly |
| 11 | 14 | } |
| 12 | 15 | |
| 13 | 16 | // Form Settings |
| 14 | -Merchant_Admin_Options::create( array( | |
| 17 | + | |
| 18 | +return array( | |
| 19 | + array( | |
| 15 | 20 | 'title' => esc_html__( 'Form Settings', 'merchant' ), |
| 16 | 21 | 'module' => Merchant_Wait_List::MODULE_ID, |
| 17 | 22 | 'fields' => array( |
| 18 | 23 | |
| @@ -63,13 +68,18 @@ | ||
| 63 | 68 | 'title' => esc_html__( 'Exclude products', 'merchant' ), |
| 64 | 69 | 'multiple' => true, |
| 65 | 70 | 'desc' => esc_html__( 'Select any products that will be excluded from the waitlist.', 'merchant' ), |
| 66 | 71 | 'allowed_types' => array( 'simple', 'variable' ), |
| 72 | + 'ai_meta' => array( | |
| 73 | + 'entity' => 'product', | |
| 74 | + 'reference_type' => 'static', | |
| 75 | + 'value_format' => 'product_id', | |
| 76 | + 'usage_hint' => 'Specific products to exclude from the waitlist globally. Static: only the selected products are excluded. For module-wide exclusion of simple and variable products by ID.', | |
| 77 | + ), | |
| 67 | 78 | ), |
| 68 | 79 | ), |
| 69 | -) ); | |
| 70 | - | |
| 71 | -Merchant_Admin_Options::create( array( | |
| 80 | +), | |
| 81 | + array( | |
| 72 | 82 | 'title' => esc_html__( 'Email Settings', 'merchant' ), |
| 73 | 83 | 'module' => Merchant_Wait_List::MODULE_ID, |
| 74 | 84 | 'fields' => array( |
| 75 | 85 | |
| @@ -140,14 +150,11 @@ | ||
| 140 | 150 | ) |
| 141 | 151 | ), |
| 142 | 152 | ), |
| 143 | 153 | ), |
| 144 | -) ); | |
| 145 | - | |
| 146 | -// Shortcode | |
| 147 | -$merchant_module_id = Merchant_Wait_List::MODULE_ID; | |
| 148 | -Merchant_Admin_Options::create( array( | |
| 149 | - 'module' => $merchant_module_id, | |
| 154 | +), | |
| 155 | + array( | |
| 156 | + 'module' => Merchant_Wait_List::MODULE_ID, | |
| 150 | 157 | 'title' => esc_html__( 'Use shortcode', 'merchant' ), |
| 151 | 158 | 'fields' => array( |
| 152 | 159 | array( |
| 153 | 160 | 'id' => 'use_shortcode', |
| @@ -163,9 +170,10 @@ | ||
| 163 | 170 | array( |
| 164 | 171 | 'id' => 'shortcode_text', |
| 165 | 172 | 'type' => 'text_readonly', |
| 166 | 173 | 'title' => esc_html__( 'Shortcode text', 'merchant' ), |
| 167 | - 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']', | |
| 174 | + 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Wait_List::MODULE_ID ) . ']', | |
| 168 | 175 | 'condition' => array( 'use_shortcode', '==', '1' ), |
| 169 | 176 | ), |
| 170 | 177 | ), |
| 171 | -) ); | |
| 178 | +), | |
| 179 | +); | |