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' ) ) {

			llms_log( 'Filter `llms_get_quiz_theme_settings` deprecated since 3.17.6, for more information see new methods at https://lifterlms.com/docs/course-builder-custom-fields-for-developers/' );

			$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(
				'title' => sprintf( __( '%s Theme Settings', 'lifterlms' ), $theme->get( 'Name' ) ),
				'toggleable' => true,
				'fields' => array( array( $field ) ),
			);

		}
		// end backwards compat

		return apply_filters( 'llms_builder_register_custom_fields', array(
			'lesson' => array(),
			'quiz' => $quiz_fields,
		) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.17.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: