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/autocomplete.php +4 -5 4.2.04.4.8 View file →
@@ -65,9 +65,10 @@
65 65 'nonce' => wp_create_nonce( 'wp_rest' ),
66 66 'rest_url' => rest_url(),
67 67 );
68 68 ?>
69 - <p class="form-field lp_autocomplete_metabox_field <?php echo esc_attr( $field['id'] . '_field ' . $wrapper_class ); ?>" data-atts="<?php echo esc_attr( wp_json_encode( $data_atts ) ); ?>">
69 + <p class="form-field lp_autocomplete_metabox_field <?php echo esc_attr( $field['id'] . '_field ' . $wrapper_class ); ?>"
70 + data-atts="<?php echo esc_attr( wp_json_encode( $data_atts ) ); ?>">
70 71 <label for="<?php echo esc_attr( $field['id'] ); ?>">
71 72 <?php echo wp_kses_post( $field['label'] ); ?>
72 73 </label>
73 74
@@ -114,13 +115,11 @@
114 115 <?php
115 116 }
116 117
117 118 public function save( $post_id ) {
118 - $raw_value = isset( $_POST[ $this->id ] ) ? (array) wp_unslash( $_POST[ $this->id ] ) : array();
119 - $value = array_map( 'absint', $raw_value );
120 - $value = apply_filters( 'learn-press/admin/metabox/autocomplete/' . $this->id . '/save', $value, $raw_value, $post_id );
119 + $value = LP_Request::get_param( $this->id, $this->default ?? [] );
121 120
122 121 update_post_meta( $post_id, $this->id, $value );
123 122
124 - do_action( 'lp/metabox/field/autocomplete/save/after', $post_id, $this->id, $value );
123 + return $value;
125 124 }
126 125 }