PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
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 4.2.0 All 139 releases
← All changes | inc/admin/views/meta-boxes/fields/repeater.php +4 -2 4.2.04.4.8 View file →
@@ -55,9 +55,9 @@
55 55 <?php
56 56 }
57 57
58 58 public function save( $post_id ) {
59 - $data = isset( $_POST[ $this->id ] ) ? wp_unslash( $_POST[ $this->id ] ) : array();
59 + $data = LP_Request::get_param( $this->id, $this->default ?? [], 'html' );
60 60 $output = array();
61 61
62 62 if ( ! empty( $data ) && is_array( $data ) ) {
63 63 foreach ( $data as $key => $val ) {
@@ -74,8 +74,10 @@
74 74 }
75 75 }
76 76
77 77 update_post_meta( $post_id, $this->id, $output );
78 +
79 + return $output;
78 80 }
79 81
80 82 public function repeater_html( $thepostid, $repeater, $is_attr = false, $key = 'lp_metabox_repeater_key' ) {
81 83 ?>
@@ -94,9 +96,9 @@
94 96 <?php
95 97 if ( isset( $this->extra['fields'] ) ) {
96 98 foreach ( $this->extra['fields'] as $field_key => $field ) {
97 99 $field->id = $this->id . '[' . $key . '][' . $field_key . ']';
98 - $field->extra['value'] = $is_attr ? '' : $repeater[ $field_key ];
100 + $field->extra['value'] = $is_attr ? '' : ( $repeater[ $field_key ] ?? '' );
99 101 learn_press_echo_vuejs_write_on_php( $field->output( $thepostid ) );
100 102 }
101 103 }
102 104 ?>