Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_Builder::get_custom_schemas()

Retrieve custom field schemas


Description Description


Return Return

(array)


Top ↑

Source Source

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

	private static function get_custom_schemas() {

		$quiz_fields = array();

		/**
		 * Handle old quiz layout compatibility API:
		 * Translate the old filter into the new one for quizzes.
		 */
		if ( get_theme_support( 'lifterlms-quizzes' ) && has_filter( 'llms_get_quiz_theme_settings' ) ) {

			$theme = wp_get_theme();

			$old = llms_get_quiz_theme_setting( 'layout' );

			$field = array(
				'attribute' => $old['id'],
				'id'        => $old['id'],
				'label'     => $old['name'],
				'type'      => ( 'select' === $old['type'] ) ? 'select' : 'radio',
				'options'   => $old['options'],
			);

			if ( isset( $old['id_prefix'] ) ) {
				$field['attribute_prefix'] = $old['id_prefix'];
			}

			$quiz_fields[ sprintf( '%s_backwards_theme_group', $theme->get_stylesheet() ) ] = array(
				// Translators: %s = Theme name.
				'title'      => sprintf( __( '%s Theme Settings', 'lifterlms' ), $theme->get( 'Name' ) ),
				'toggleable' => true,
				'fields'     => array( array( $field ) ),
			);

		}

		/**
		 * Add custom fields to the LifterLMS Builder.
		 *
		 * @since 3.17.0
		 *
		 * @link https://lifterlms.com/docs/course-builder-custom-fields-for-developers
		 *
		 * @param array[] $fields Array of post types containing arrays of custom field data.
		 */
		return apply_filters(
			'llms_builder_register_custom_fields',
			array(
				'lesson' => array(),
				'quiz'   => $quiz_fields,
			)
		);
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.38.0 Only run backwards compatibility for llms_get_quiz_theme_settings when the filter is being used.
3.17.6 Add backwards compatibility for the deprecated llms_get_quiz_theme_settings filter.
3.17.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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