diff --git a/src/Field/ImageInputField.php b/src/Field/ImageInputField.php index dd4226c14e7e0a051c4ca077c3d870fde3643e91..95d4bb68f3492b3139f2ebb56a3d4c379ad4d5c0 100644 --- a/src/Field/ImageInputField.php +++ b/src/Field/ImageInputField.php @@ -2,7 +2,7 @@ namespace WPDesk\Forms\Field; -class ImageInputField extends \WPDesk\Forms\Field\BasicField { +class ImageInputField extends BasicField { public function __construct() { parent::__construct(); diff --git a/templates/input-image.php b/templates/input-image.php index 8b805c6d977cccdff1d187eaf0c802c83041cb3e..18fba1b21f82e8488fe9b73b995fb002ef98d5f6 100644 --- a/templates/input-image.php +++ b/templates/input-image.php @@ -4,8 +4,7 @@ * @var string $name_prefix * @var string $value */ -?> -<?php + $media_container_id = 'media_' . sanitize_key( $field->get_id() ); ?> <div class="media-input-wrapper" id="<?php echo $media_container_id; ?>"> @@ -18,14 +17,10 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() ); <?php endif; ?> </div> <p class="hide-if-no-js"> - <a class="upload-custom-img <?php if ( $value ) { - echo 'hidden'; - } ?>" href="<?php echo $value ?>"> + <a class="upload-custom-img <?php if ( $value ): ?>hidden<?php endif ?>" href="<?php echo $value ?>"> <?php _e( 'Set image', 'wp-forms' ) ?> </a> - <a class="delete-custom-img <?php if ( ! $value ) { - echo 'hidden'; - } ?>" href="#"> + <a class="delete-custom-img <?php if ( ! $value ): ?>hidden<?php endif ?>" href="#"> <?php _e( 'Remove image', 'wp-forms' ) ?> </a> </p>