PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.8
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / admin / views / sp-framework / fields / slider / slider.php

slider.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at admin/views/sp-framework/fields/slider/slider.php

83 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Framework slider field.
4 *
5 * @link https://shapedplugin.com/
6 *
7 * @package Smart_Post_Show
8 * @subpackage Smart_Post_Show/admin/views
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 die;
13 } // Cannot access directly.
14
15 if ( ! class_exists( 'SP_PC_Field_slider' ) ) {
16 /**
17 *
18 * Field: slider
19 *
20 * @since 1.0.0
21 * @version 1.0.0
22 */
23 class SP_PC_Field_slider extends SP_PC_Fields {
24
25 /**
26 * Field constructor.
27 *
28 * @param array $field The field type.
29 * @param string $value The values of the field.
30 * @param string $unique The unique ID for the field.
31 * @param string $where To where show the output CSS.
32 * @param string $parent The parent args.
33 */
34 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
35 parent::__construct( $field, $value, $unique, $where, $parent );
36 }
37
38 /**
39 * Render
40 *
41 * @return void
42 */
43 public function render() {
44
45 $args = wp_parse_args(
46 $this->field,
47 array(
48 'max' => 100,
49 'min' => 0,
50 'step' => 1,
51 'unit' => '',
52 )
53 );
54
55 $is_unit = ( ! empty( $args['unit'] ) ) ? ' spf--is-unit' : '';
56
57 echo wp_kses_post( $this->field_before() );
58
59 echo '<div class="spf--wrap">';
60 echo '<div class="spf-slider-ui"></div>';
61 echo '<div class="spf--input">';
62 echo '<input type="number" name="' . esc_attr( $this->field_name() ) . '" value="' . esc_attr( $this->value ) . '"' . $this->field_attributes( array( 'class' => 'spf-input-number' . esc_attr( $is_unit ) ) ) . ' data-min="' . esc_attr( $args['min'] ) . '" data-max="' . esc_attr( $args['max'] ) . '" data-step="' . esc_attr( $args['step'] ) . '" step="any" />';// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
63 echo ( ! empty( $args['unit'] ) ) ? '<span class="spf--unit">' . esc_attr( $args['unit'] ) . '</span>' : '';
64 echo '</div>';
65 echo '</div>';
66
67 echo wp_kses_post( $this->field_after() );
68 }
69
70 /**
71 * Enqueue
72 *
73 * @return void
74 */
75 public function enqueue() {
76
77 if ( ! wp_script_is( 'jquery-ui-slider' ) ) {
78 wp_enqueue_script( 'jquery-ui-slider' );
79 }
80 }
81 }
82 }
83