PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/admin/views/meta-boxes/fields/repeater.php +11 -7 4.1.6.9 → 4.4.9 View file →
@@ -26,9 +26,11 @@
26 26 $repeaters = $this->meta_value( $thepostid );
27 27 ?>
28 28
29 29 <div class="form-field lp_repeater_meta_box">
30 - <label for="_lp_key_features"><?php echo $this->label; ?></label>
30 + <label for="_lp_key_features">
31 + <?php echo wp_kses_post( $this->label ); ?>
32 + </label>
31 33 <div class="lp_repeater_meta_box__wrapper">
32 34 <div class="lp_repeater_meta_box__fields">
33 35 <?php if ( ! empty( $repeaters ) ) : ?>
34 36 <?php foreach ( $repeaters as $key => $repeater ) : ?>
@@ -44,9 +46,9 @@
44 46 $this->repeater_html( $thepostid, false, true );
45 47 echo esc_attr( ob_get_clean() );
46 48 ?>
47 49 ">
48 - <?php echo isset( $this->extra['add_text'] ) ? $this->extra['add_text'] : esc_html__( '+ Add more', 'learnpress' ); ?>
50 + <?php echo wp_kses_post( $this->extra['add_text'] ?? esc_html__( '+ Add more', 'learnpress' ) ); ?>
49 51 </a>
50 52 </div>
51 53 </div>
52 54
@@ -53,9 +55,9 @@
53 55 <?php
54 56 }
55 57
56 58 public function save( $post_id ) {
57 - $data = isset( $_POST[ $this->id ] ) ? wp_unslash( $_POST[ $this->id ] ) : array();
59 + $data = LP_Request::get_param( $this->id, $this->default ?? [], 'html' );
58 60 $output = array();
59 61
60 62 if ( ! empty( $data ) && is_array( $data ) ) {
61 63 foreach ( $data as $key => $val ) {
@@ -72,18 +74,20 @@
72 74 }
73 75 }
74 76
75 77 update_post_meta( $post_id, $this->id, $output );
78 +
79 + return $output;
76 80 }
77 81
78 82 public function repeater_html( $thepostid, $repeater, $is_attr = false, $key = 'lp_metabox_repeater_key' ) {
79 83 ?>
80 - <div class="lp_repeater_meta_box__field <?php echo $is_attr ? 'lp_repeater_meta_box__field_active' : ''; ?>">
84 + <div class="lp_repeater_meta_box__field <?php echo esc_attr( $is_attr ? 'lp_repeater_meta_box__field_active' : '' ); ?>">
81 85 <input class="lp_repeater_meta_box__field__count" type="hidden" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $this->id ) . '[' . $key . ']' . '[sort]'; ?>">
82 86 <div class="lp_repeater_meta_box__title">
83 87 <span class="lp_repeater_meta_box__title__sort"></span>
84 88 <span class="lp_repeater_meta_box__title__title">
85 - <?php echo isset( $this->extra['title_text'] ) ? $this->extra['title_text'] : esc_html__( 'Repeater', 'learnpress' ); ?>
89 + <?php echo wp_kses_post( $this->extra['title_text'] ?? esc_html__( 'Repeater', 'learnpress' ) ); ?>
86 90 <span><?php echo esc_html( absint( $key ) + 1 ); ?></span>
87 91 </span>
88 92 <a href="#" class="lp_repeater_meta_box__title__delete"></a>
89 93 <a href="#" class="lp_repeater_meta_box__title__toggle"></a>
@@ -92,10 +96,10 @@
92 96 <?php
93 97 if ( isset( $this->extra['fields'] ) ) {
94 98 foreach ( $this->extra['fields'] as $field_key => $field ) {
95 99 $field->id = $this->id . '[' . $key . '][' . $field_key . ']';
96 - $field->extra['value'] = $is_attr ? '' : $repeater[ $field_key ];
97 - echo $field->output( $thepostid );
100 + $field->extra['value'] = $is_attr ? '' : ( $repeater[ $field_key ] ?? '' );
101 + learn_press_echo_vuejs_write_on_php( $field->output( $thepostid ) );
98 102 }
99 103 }
100 104 ?>
101 105 </div>