← All changes
|
inc/modules/countdown-timer/class-countdown-timer.php
+21
-13
1.10.4
→
2.3.2
View file →
| @@ -33,8 +33,17 @@ | ||
| 33 | 33 | */ |
| 34 | 34 | public static $is_module_preview = false; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | + * Initialize the module's option group definitions. | |
| 38 | + * | |
| 39 | + * @return array<int, array<string, mixed>> Array of option group arrays. | |
| 40 | + */ | |
| 41 | + protected function init_option_groups() { | |
| 42 | + return require MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; | |
| 43 | + } | |
| 44 | + | |
| 45 | + /** | |
| 37 | 46 | * Constructor. |
| 38 | 47 | */ |
| 39 | 48 | public function __construct() { |
| 40 | 49 | // Module id. |
| @@ -59,22 +68,21 @@ | ||
| 59 | 68 | 'max_expiration_deadline' => 26, |
| 60 | 69 | 'sale_ending_alignment' => 'left', |
| 61 | 70 | ); |
| 62 | 71 | |
| 63 | - // Mount preview url. | |
| 64 | - $preview_url = site_url( '/' ); | |
| 72 | + // Module data. | |
| 73 | + $this->module_data = Merchant_Admin_Modules::$modules_data[ self::MODULE_ID ]; | |
| 65 | 74 | |
| 66 | - if ( function_exists( 'wc_get_products' ) ) { | |
| 67 | - $products = wc_get_products( array( 'limit' => 1 ) ); | |
| 68 | - | |
| 69 | - if ( ! empty( $products ) && ! empty( $products[0] ) ) { | |
| 70 | - $preview_url = get_permalink( $products[0]->get_id() ); | |
| 71 | - } | |
| 72 | - } | |
| 73 | - | |
| 74 | - // Module data. | |
| 75 | - $this->module_data = Merchant_Admin_Modules::$modules_data[ self::MODULE_ID ]; | |
| 76 | - $this->module_data['preview_url'] = $preview_url; | |
| 75 | + // AI prompt examples. | |
| 76 | + $this->ai_examples = array( | |
| 77 | + 'blurb' => esc_html__( 'See what AI can do for your countdown timer, from setting when the sale ends to restyling how the timer looks.', 'merchant' ), | |
| 78 | + 'prompts' => array( | |
| 79 | + esc_html__( 'Explore the abilities WPVibe gives you access to, then switch the countdown timer to sale-price dates and set it to end at midnight on November 30 for our Black Friday sale', 'merchant' ), | |
| 80 | + esc_html__( 'Check what abilities you have available through WPVibe, then switch the countdown timer to an evergreen timer that gives each visitor a fresh 24-hour deadline', 'merchant' ), | |
| 81 | + esc_html__( "Look at your available WPVibe abilities, then change the sale ending message above the countdown timer to 'Black Friday ends in' and center it", 'merchant' ), | |
| 82 | + esc_html__( 'See what abilities WPVibe exposes, then switch the countdown timer to the Circles layout with red digits', 'merchant' ), | |
| 83 | + ), | |
| 84 | + ); | |
| 77 | 85 | |
| 78 | 86 | // Module options path. |
| 79 | 87 | $this->module_options_path = MERCHANT_DIR . 'inc/modules/' . self::MODULE_ID . '/admin/options.php'; |
| 80 | 88 | |