| 1 |
<?php |
| 2 |
/** |
| 3 |
* Trust Badges — Option group definitions. |
| 4 |
* |
| 5 |
* Pure data file. Returns the option groups array |
| 6 |
* consumed by Merchant_Trust_Badges::init_option_groups(). |
| 7 |
* |
| 8 |
* @package Merchant |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; // Exit if accessed directly |
| 13 |
} |
| 14 |
|
| 15 |
return array( |
| 16 |
// ── Trust Badges ───────────────────────────────────────────────── |
| 17 |
array( |
| 18 |
'title' => esc_html__( 'Trust Badges', 'merchant' ), |
| 19 |
'module' => Merchant_Trust_Badges::MODULE_ID, |
| 20 |
'fields' => array( |
| 21 |
array( |
| 22 |
'id' => 'default_badges', |
| 23 |
'type' => 'choices', |
| 24 |
'multiple' => true, |
| 25 |
'title' => esc_html__( 'Default badges', 'merchant' ), |
| 26 |
'options' => array( |
| 27 |
'badge1' => MERCHANT_URI . 'inc/modules/' . Merchant_Trust_Badges::MODULE_ID . '/admin/images/badge1.svg', |
| 28 |
'badge2' => MERCHANT_URI . 'inc/modules/' . Merchant_Trust_Badges::MODULE_ID . '/admin/images/badge2.svg', |
| 29 |
'badge3' => MERCHANT_URI . 'inc/modules/' . Merchant_Trust_Badges::MODULE_ID . '/admin/images/badge3.svg', |
| 30 |
), |
| 31 |
), |
| 32 |
array( |
| 33 |
'id' => 'badges', |
| 34 |
'type' => 'gallery', |
| 35 |
'label' => esc_html__( 'Select badges', 'merchant' ), |
| 36 |
), |
| 37 |
), |
| 38 |
), |
| 39 |
// ── Settings ───────────────────────────────────────────────────── |
| 40 |
array( |
| 41 |
'title' => esc_html__( 'Settings', 'merchant' ), |
| 42 |
'module' => Merchant_Trust_Badges::MODULE_ID, |
| 43 |
'fields' => array( |
| 44 |
array( |
| 45 |
'id' => 'align', |
| 46 |
'type' => 'select', |
| 47 |
'title' => esc_html__( 'Align logos', 'merchant' ), |
| 48 |
'options' => array( |
| 49 |
'flex-start' => esc_html__( 'Left', 'merchant' ), |
| 50 |
'center' => esc_html__( 'Center', 'merchant' ), |
| 51 |
'flex-end' => esc_html__( 'Right', 'merchant' ), |
| 52 |
), |
| 53 |
'default' => 'center', |
| 54 |
), |
| 55 |
array( |
| 56 |
'id' => 'title', |
| 57 |
'type' => 'text', |
| 58 |
'title' => esc_html__( 'Text above the logos', 'merchant' ), |
| 59 |
'default' => esc_html__( 'Product Quality Guaranteed!', 'merchant' ), |
| 60 |
), |
| 61 |
array( |
| 62 |
'id' => 'font-size', |
| 63 |
'type' => 'range', |
| 64 |
'title' => esc_html__( 'Font size', 'merchant' ), |
| 65 |
'min' => 1, |
| 66 |
'max' => 250, |
| 67 |
'step' => 1, |
| 68 |
'default' => 15, |
| 69 |
'unit' => 'px', |
| 70 |
), |
| 71 |
array( |
| 72 |
'id' => 'text-color', |
| 73 |
'type' => 'color', |
| 74 |
'title' => esc_html__( 'Text color', 'merchant' ), |
| 75 |
'default' => '#212121', |
| 76 |
), |
| 77 |
array( |
| 78 |
'id' => 'border-color', |
| 79 |
'type' => 'color', |
| 80 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 81 |
'default' => '#e5e5e5', |
| 82 |
), |
| 83 |
array( |
| 84 |
'id' => 'margin-top', |
| 85 |
'type' => 'range', |
| 86 |
'title' => esc_html__( 'Margin top', 'merchant' ), |
| 87 |
'min' => 1, |
| 88 |
'max' => 250, |
| 89 |
'step' => 1, |
| 90 |
'default' => 20, |
| 91 |
'unit' => 'px', |
| 92 |
), |
| 93 |
array( |
| 94 |
'id' => 'margin-bottom', |
| 95 |
'type' => 'range', |
| 96 |
'title' => esc_html__( 'Margin bottom', 'merchant' ), |
| 97 |
'min' => 1, |
| 98 |
'max' => 250, |
| 99 |
'step' => 1, |
| 100 |
'default' => 20, |
| 101 |
'unit' => 'px', |
| 102 |
), |
| 103 |
array( |
| 104 |
'id' => 'image-max-width', |
| 105 |
'type' => 'range', |
| 106 |
'title' => esc_html__( 'Image max width', 'merchant' ), |
| 107 |
'min' => 1, |
| 108 |
'max' => 250, |
| 109 |
'step' => 1, |
| 110 |
'default' => 70, |
| 111 |
'unit' => 'px', |
| 112 |
), |
| 113 |
array( |
| 114 |
'id' => 'image-max-height', |
| 115 |
'type' => 'range', |
| 116 |
'title' => esc_html__( 'Image max height', 'merchant' ), |
| 117 |
'min' => 1, |
| 118 |
'max' => 250, |
| 119 |
'step' => 1, |
| 120 |
'default' => 70, |
| 121 |
'unit' => 'px', |
| 122 |
), |
| 123 |
), |
| 124 |
), |
| 125 |
// ── Use shortcode ──────────────────────────────────────────────── |
| 126 |
array( |
| 127 |
'module' => Merchant_Trust_Badges::MODULE_ID, |
| 128 |
'title' => esc_html__( 'Use shortcode', 'merchant' ), |
| 129 |
'fields' => array( |
| 130 |
array( |
| 131 |
'id' => 'use_shortcode', |
| 132 |
'type' => 'switcher', |
| 133 |
'title' => __( 'Use shortcode', 'merchant' ), |
| 134 |
'default' => 0, |
| 135 |
), |
| 136 |
array( |
| 137 |
'type' => 'info', |
| 138 |
'id' => 'shortcode_info', |
| 139 |
'content' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.', 'merchant' ), |
| 140 |
), |
| 141 |
array( |
| 142 |
'id' => 'shortcode_text', |
| 143 |
'type' => 'text_readonly', |
| 144 |
'title' => esc_html__( 'Shortcode text', 'merchant' ), |
| 145 |
'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Trust_Badges::MODULE_ID ) . ']', |
| 146 |
'condition' => array( 'use_shortcode', '==', '1' ), |
| 147 |
), |
| 148 |
), |
| 149 |
), |
| 150 |
); |