field, array( 'top_icon' => '', 'right_icon' => '', 'bottom_icon' => '', 'left_icon' => '', 'all_icon' => '', 'arrow_v' => '', 'arrow_h' => '', 'top_placeholder' => esc_html__( 'top', 'post-carousel' ), 'right_placeholder' => esc_html__( 'right', 'post-carousel' ), 'bottom_placeholder' => esc_html__( 'bottom', 'post-carousel' ), 'left_placeholder' => esc_html__( 'left', 'post-carousel' ), 'all_placeholder' => esc_html__( 'all', 'post-carousel' ), 'top_bottom_title' => esc_html__( 'Vertical Gap', 'post-carousel' ), 'left_right_title' => esc_html__( 'Gap', 'post-carousel' ), 'all_placeholder' => esc_html__( 'all', 'post-carousel' ), 'top' => true, 'left' => true, 'bottom' => true, 'right' => true, 'unit' => true, 'show_units' => true, 'all' => false, 'gap_between' => false, 'units' => array( 'px', '%', 'em' ), ) ); $default_values = array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', 'all' => '', 'top-bottom' => '', 'left-right' => '', 'unit' => 'px', ); $value = wp_parse_args( $this->value, $default_values ); $unit = ( count( $args['units'] ) === 1 && ! empty( $args['unit'] ) ) ? $args['units'][0] : ''; $is_unit = ( ! empty( $unit ) ) ? ' spf--is-unit' : ''; echo wp_kses_post( $this->field_before() ); echo '
'; if ( ! empty( $args['all'] ) ) { $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="' . esc_attr( $args['all_placeholder'] ) . '"' : ''; echo '
'; echo ( ! empty( $args['all_icon'] ) ) ? '' . wp_kses_post( $args['all_icon'] ) . '' : ''; echo ''; echo ( $unit ) ? '' . esc_attr( $args['units'][0] ) . '' : ''; echo '
'; } elseif ( $args['gap_between'] ) { foreach ( array( 'left-right', 'top-bottom' ) as $prop ) { $placeholder = ( ! empty( $args['all_placeholder'] ) ) ? ' placeholder="' . esc_attr( $args['all_placeholder'] ) . '"' : ''; $icon = ( 'top-bottom' === $prop ) ? 'arrow_v' : 'arrow_h'; $name = ( 'top-bottom' === $prop ) ? 'top-bottom' : 'left-right'; $title = ( 'top-bottom' === $prop ) ? esc_attr( $args['top_bottom_title'] ) : esc_attr( $args['left_right_title'] ); echo '
'; echo '
' . esc_html( $title ) . '
'; echo '
'; echo ( ! empty( $args[ $icon ] ) ) ? '' . wp_kses_post( $args[ $icon ] ) . '' : ''; echo ''; echo ( $unit ) ? '' . esc_attr( $args['units'][0] ) . '' : ''; echo '
'; echo '
'; } } else { $properties = array(); foreach ( array( 'top', 'right', 'bottom', 'left' ) as $prop ) { if ( ! empty( $args[ $prop ] ) ) { $properties[] = $prop; } } $properties = ( array( 'right', 'left' ) === $properties ) ? array_reverse( $properties ) : $properties; foreach ( $properties as $property ) { echo '
'; echo '
' . esc_html( $property ) . '
'; echo '
'; echo ( ! empty( $args[ $property . '_icon' ] ) ) ? '' . wp_kses_post( $args[ $property . '_icon' ] ) . '' : ''; echo ''; echo ( $unit ) ? '' . esc_attr( $args['units'][0] ) . '' : ''; echo '
'; echo '
'; } } if ( ! empty( $args['unit'] ) && ! empty( $args['show_units'] ) && count( $args['units'] ) > 1 ) { echo '
'; echo '
'; echo ''; echo '
'; echo '
'; } echo '
'; echo wp_kses_post( $this->field_after() ); } } }