__('Shortcode', 'wp-multisite-waas'), ]; } /** * Returns the list of additional fields specific to this type. * * @since 2.0.0 * @return array */ public function get_fields() { return [ 'shortcode_code' => [ 'type' => 'text', 'title' => __('Shortcode', 'wp-multisite-waas'), 'placeholder' => __('e.g. [shortcode]', 'wp-multisite-waas'), 'desc' => __('Please, enter the full shortcode, including [].', 'wp-multisite-waas'), ], ]; } /** * Returns the field/element actual field array to be used on the checkout form. * * @since 2.0.0 * * @param array $attributes Attributes saved on the editor form. * @return array An array of fields, not the field itself. */ public function to_fields_array($attributes) { return [ $attributes['id'] => [ 'type' => 'note', 'desc' => fn() => do_shortcode($attributes['shortcode_code']), 'wrapper_classes' => wu_get_isset($attributes, 'wrapper_element_classes', ''), 'classes' => wu_get_isset($attributes, 'element_classes', ''), 'wrapper_html_attr' => [ 'style' => $this->calculate_style_attr(), ], ], ]; } }