LLMS_Admin_Reviews::add_review_meta_boxes( array $content )

This function builds the additional content that is added to the course meta box. It builds the additional fields and then returns the updated array of fields


Parameters Parameters

$content

(array) (Required) Array of meta fields


Top ↑

Return Return

(array) Updated array of meta fields


Top ↑

Source Source

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

	public function add_review_meta_boxes( $content ) {

		/**
		 * This array is what holds the updated fields.
		 * It is created in such a way so that a plugin
		 * can latch onto it to extend the review functionality
		 *
		 * @var array
		 */
		$fields = array(
			array(
				'type'       => 'checkbox',
				'label'      => __( 'Enable Reviews', 'lifterlms' ),
				'desc'       => __( 'Select to enable reviews.', 'lifterlms' ),
				'id'         => self::$prefix . 'llms_reviews_enabled',
				'class'      => '',
				'value'      => '1',
				'desc_class' => 'd-3of4 t-3of4 m-1of2',
				'group'      => '',
			),
			array(
				'type'       => 'checkbox',
				'label'      => __( 'Display Reviews', 'lifterlms' ),
				'desc'       => __( 'Select to display reviews on the page.', 'lifterlms' ),
				'id'         => self::$prefix . 'llms_display_reviews',
				'class'      => 'llms-num-reviews-top',
				'value'      => '1',
				'desc_class' => 'd-3of4 t-3of4 m-1of2',
				'group'      => 'llms-num-reviews-top',
			),
			array(
				'type'       => 'number',
				'min'        => '0',
				'label'      => __( 'Number of Reviews', 'lifterlms' ),
				'desc'       => __( 'Number of reviews to display on the page.', 'lifterlms' ),
				'id'         => self::$prefix . 'llms_num_reviews',
				'class'      => 'input-full',
				'value'      => '',
				'desc_class' => 'd-all',
				'group'      => 'bottom llms-num-reviews-bottom',
			),
			array(
				'type'       => 'checkbox',
				'label'      => __( 'Prevent Multiple Reviews', 'lifterlms' ),
				'desc'       => __( 'Select to prevent a user from submitting more than one review.', 'lifterlms' ),
				'id'         => self::$prefix . 'llms_multiple_reviews_disabled',
				'class'      => '',
				'value'      => '1',
				'desc_class' => 'd-3of4 t-3of4 m-1of2',
				'group'      => '',
			),
		);

		if ( has_filter( 'llms_review_fields' ) ) {
			$fields = apply_filters( 'llms_review_fields', $fields );
		}

		$metaboxtab = array(
			'title'  => __( 'Reviews', 'lifterlms' ),
			'fields' => $fields,
		);
		array_push( $content, $metaboxtab );
		return $content;
	}


Top ↑

User Contributed Notes User Contributed Notes

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