| @@ -35,10 +35,10 @@ | ||
| 35 | 35 | array( |
| 36 | 36 | 'url' => true, |
| 37 | 37 | 'preview' => true, |
| 38 | 38 | 'library' => array(), |
| 39 | - 'button_title' => esc_html__( 'Upload', 'post-carousel' ), | |
| 40 | - 'remove_title' => esc_html__( 'Remove', 'post-carousel' ), | |
| 39 | + 'button_title' => esc_html__( 'Upload', 'smart-post-show' ), | |
| 40 | + 'remove_title' => esc_html__( 'Remove', 'smart-post-show' ), | |
| 41 | 41 | 'preview_size' => 'thumbnail', |
| 42 | 42 | ) |
| 43 | 43 | ); |
| 44 | 44 | |
| @@ -64,36 +64,36 @@ | ||
| 64 | 64 | $this->value = wp_parse_args( $this->value, $default_values ); |
| 65 | 65 | |
| 66 | 66 | $library = ( is_array( $args['library'] ) ) ? $args['library'] : array_filter( (array) $args['library'] ); |
| 67 | 67 | $library = ( ! empty( $library ) ) ? implode( ',', $library ) : ''; |
| 68 | - $preview_src = ( 'thumbnail' !== $args['preview_size'] ) ? $this->value['url'] : $this->value['thumbnail']; | |
| 68 | + $preview_src = ( $args['preview_size'] !== 'thumbnail' ) ? $this->value['url'] : $this->value['thumbnail']; | |
| 69 | 69 | $hidden_url = ( empty( $args['url'] ) ) ? ' hidden' : ''; |
| 70 | 70 | $hidden_auto = ( empty( $this->value['url'] ) ) ? ' hidden' : ''; |
| 71 | - $placeholder = ( empty( $this->field['placeholder'] ) ) ? ' placeholder="' . esc_html__( 'No media selected', 'post-carousel' ) . '"' : ''; | |
| 71 | + $placeholder = ( empty( $this->field['placeholder'] ) ) ? ' placeholder="' . esc_html__( 'No media selected', 'smart-post-show' ) . '"' : ''; | |
| 72 | 72 | |
| 73 | - echo wp_kses_post( $this->field_before() ); | |
| 73 | + echo $this->field_before(); | |
| 74 | 74 | |
| 75 | 75 | if ( ! empty( $args['preview'] ) ) { |
| 76 | - echo '<div class="spf--preview' . esc_attr( $hidden_auto ) . '">'; | |
| 77 | - echo '<div class="spf-image-preview"><a href="#" class="spf--remove fa fa-times"></a><img src="' . esc_url( $preview_src ) . '" class="spf--src"/></div>'; | |
| 76 | + echo '<div class="spf--preview' . $hidden_auto . '">'; | |
| 77 | + echo '<div class="spf-image-preview"><a href="#" class="spf--remove fa fa-times"></a><img src="' . $preview_src . '" class="spf--src"/></div>'; | |
| 78 | 78 | echo '</div>'; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | echo '<div class="spf--placeholder">'; |
| 82 | - echo '<input type="text" name="' . esc_url( $this->field_name( '[url]' ) ) . '" value="' . esc_url( $this->value['url'] ) . '" class="spf--url' . esc_attr( $hidden_url ) . '" readonly="readonly"' . wp_kses_post( $this->field_attributes() . $placeholder ) . ' />'; | |
| 83 | - echo '<a href="#" class="button button-primary spf--button" data-library="' . esc_attr( $library ) . '" data-preview-size="' . esc_attr( $args['preview_size'] ) . '">' . esc_html( $args['button_title'] ) . '</a>'; | |
| 84 | - echo ( empty( $args['preview'] ) ) ? '<a href="#" class="button button-secondary spf-warning-primary spf--remove' . esc_attr( $hidden_auto ) . '">' . esc_html( $args['remove_title'] ) . '</a>' : ''; | |
| 82 | + echo '<input type="text" name="' . $this->field_name( '[url]' ) . '" value="' . $this->value['url'] . '" class="spf--url' . $hidden_url . '" readonly="readonly"' . $this->field_attributes() . $placeholder . ' />'; | |
| 83 | + echo '<a href="#" class="button button-primary spf--button" data-library="' . esc_attr( $library ) . '" data-preview-size="' . esc_attr( $args['preview_size'] ) . '">' . $args['button_title'] . '</a>'; | |
| 84 | + echo ( empty( $args['preview'] ) ) ? '<a href="#" class="button button-secondary spf-warning-primary spf--remove' . $hidden_auto . '">' . $args['remove_title'] . '</a>' : ''; | |
| 85 | 85 | echo '</div>'; |
| 86 | 86 | |
| 87 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[id]' ) ) . '" value="' . esc_attr( $this->value['id'] ) . '" class="spf--id"/>'; | |
| 88 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[width]' ) ) . '" value="' . esc_attr( $this->value['width'] ) . '" class="spf--width"/>'; | |
| 89 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[height]' ) ) . '" value="' . esc_attr( $this->value['height'] ) . '" class="spf--height"/>'; | |
| 90 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[thumbnail]' ) ) . '" value="' . esc_attr( $this->value['thumbnail'] ) . '" class="spf--thumbnail"/>'; | |
| 91 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[alt]' ) ) . '" value="' . esc_attr( $this->value['alt'] ) . '" class="spf--alt"/>'; | |
| 92 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[title]' ) ) . '" value="' . esc_attr( $this->value['title'] ) . '" class="spf--title"/>'; | |
| 93 | - echo '<input type="hidden" name="' . esc_attr( $this->field_name( '[description]' ) ) . '" value="' . esc_attr( $this->value['description'] ) . '" class="spf--description"/>'; | |
| 87 | + echo '<input type="hidden" name="' . $this->field_name( '[id]' ) . '" value="' . $this->value['id'] . '" class="spf--id"/>'; | |
| 88 | + echo '<input type="hidden" name="' . $this->field_name( '[width]' ) . '" value="' . $this->value['width'] . '" class="spf--width"/>'; | |
| 89 | + echo '<input type="hidden" name="' . $this->field_name( '[height]' ) . '" value="' . $this->value['height'] . '" class="spf--height"/>'; | |
| 90 | + echo '<input type="hidden" name="' . $this->field_name( '[thumbnail]' ) . '" value="' . $this->value['thumbnail'] . '" class="spf--thumbnail"/>'; | |
| 91 | + echo '<input type="hidden" name="' . $this->field_name( '[alt]' ) . '" value="' . $this->value['alt'] . '" class="spf--alt"/>'; | |
| 92 | + echo '<input type="hidden" name="' . $this->field_name( '[title]' ) . '" value="' . $this->value['title'] . '" class="spf--title"/>'; | |
| 93 | + echo '<input type="hidden" name="' . $this->field_name( '[description]' ) . '" value="' . $this->value['description'] . '" class="spf--description"/>'; | |
| 94 | 94 | |
| 95 | - echo wp_kses_post( $this->field_after() ); | |
| 95 | + echo $this->field_after(); | |
| 96 | 96 | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | } |