LLMS_Admin_Reviews::save_review_meta_boxes()

Save metabox fields.


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.reviews.php

	public function save_review_meta_boxes() {

		// phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce verified by core before triggering hook.

		$enabled  = ( isset( $_POST['_llms_reviews_enabled'] ) ) ? llms_filter_input_sanitize_string( INPUT_POST, '_llms_reviews_enabled' ) : '';
		$display  = ( isset( $_POST['_llms_display_reviews'] ) ) ? llms_filter_input_sanitize_string( INPUT_POST, '_llms_display_reviews' ) : '';
		$num      = ( isset( $_POST['_llms_num_reviews'] ) ) ? llms_filter_input_sanitize_string( INPUT_POST, '_llms_num_reviews' ) : 0;
		$multiple = ( isset( $_POST['_llms_multiple_reviews_disabled'] ) ) ? llms_filter_input_sanitize_string( INPUT_POST, '_llms_multiple_reviews_disabled' ) : '';

		$post_id = llms_filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT );

		if ( $post_id ) {
			update_post_meta( $post_id, '_llms_reviews_enabled', $enabled );
			update_post_meta( $post_id, '_llms_display_reviews', $display );
			update_post_meta( $post_id, '_llms_num_reviews', $num );
			update_post_meta( $post_id, '_llms_multiple_reviews_disabled', $multiple );
		}
		// phpcs:enable WordPress.Security.NonceVerification.Missing

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.