PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.2.7
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.2.7
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 / admin / classes / admin-options / fields / fields-group / status.php

status.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 2.2.7, at admin/classes/admin-options/fields/fields-group/status.php

65 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template: Fields Group — status dropdown partial.
4 *
5 * Renders the status (active/inactive) select field for a fields group.
6 *
7 * @var array<string, mixed> $settings Field settings.
8 * @var mixed $value Field value.
9 * @var string $module_id Module ID.
10 * @var bool $inside_flexible Whether group is inside flexible_content.
11 * @var array<string, mixed> $args Extra args when inside flexible_content.
12 *
13 * @package Merchant
14 * @since 2.2.5
15 */
16
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit;
19 }
20
21 /**
22 * Filter the status field configuration.
23 *
24 * @since 1.9.12
25 *
26 * @param array $status_field Status field configuration.
27 * @param array $settings Parent group settings.
28 * @param mixed $value Group value.
29 * @param string $module_id Module ID.
30 */
31 $status_field = apply_filters(
32 'merchant_group_status_field',
33 array(
34 'id' => $settings['id'] . '_status',
35 'type' => 'select',
36 'title' => esc_html__( 'Status', 'merchant' ),
37 'options' => array(
38 'inactive' => esc_html__( 'Inactive', 'merchant' ),
39 'active' => esc_html__( 'Active', 'merchant' ),
40 ),
41 'default' => isset( $settings['default'] ) ? $settings['default'] : 'active',
42 ),
43 $settings,
44 $value,
45 $module_id
46 );
47
48 if ( $inside_flexible ) {
49 Merchant_Field_Fields_Group::render_sub_field(
50 $status_field,
51 isset( $args['value'][ $settings['id'] ][ $status_field['id'] ] ) ? $args['value'][ $settings['id'] ][ $status_field['id'] ] : $status_field['default'] ?? '',
52 "name=\"merchant[{$status_field['id']}]",
53 "name=\"merchant[{$args['id']}][{$args['option_key']}][{$settings['id']}][{$status_field['id']}]\" data-name=\"merchant[{$args['id']}][0][{$settings['id']}][{$status_field['id']}]",
54 $module_id
55 );
56 } else {
57 Merchant_Field_Fields_Group::render_sub_field(
58 $status_field,
59 isset( $value[ $status_field['id'] ] ) ? $value[ $status_field['id'] ] : '',
60 "name=\"merchant[{$status_field['id']}]",
61 "name=\"merchant[{$settings['id']}][{$status_field['id']}]",
62 $module_id
63 );
64 }
65