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
Return Return
(array)
Source Source
File: includes/admin/class.llms.admin.builder.php
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | 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 * * * @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 , ) ); } |
Expand full source code Collapse full source code View on GitHub
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. |