__('Shortcode', 'wp-ultimo'), ); } /** * Returns the list of additional fields specific to this type. * * @since 2.0.0 * @return array */ public function get_fields() { return array( 'shortcode_code' => array( 'type' => 'text', 'title' => __('Shortcode', 'wp-ultimo'), 'placeholder' => __('e.g. [shortcode]', 'wp-ultimo'), 'desc' => __('Please, enter the full shortcode, including [].', 'wp-ultimo'), ), ); } /** * 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 array( $attributes['id'] => array( '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' => array( 'style' => $this->calculate_style_attr(), ), ), ); } }