'; echo ''; // For field with additional options / sub-fields, we add a wrapper to enclose field descriptions if ( array_key_exists( 'field_options_wrapper', $args ) && $args['field_options_wrapper'] ) { // For when the options / sub-fields occupy lengthy vertical space, we add show all / less toggler if ( array_key_exists( 'field_options_moreless', $args ) && $args['field_options_moreless'] ) { echo '
'; echo 'Expand ▼'; echo '
'; } else { echo '
'; echo '
'; } } echo '
' . wp_kses_post( $field_description ) . '
'; // For field with additional options / sub-fields, we add wrapper for them if ( array_key_exists( 'field_options_wrapper', $args ) && $args['field_options_wrapper'] ) { echo ''; } // For field with additional options / sub-fields, we add a wrapper to enclose field descriptions if ( array_key_exists( 'field_options_wrapper', $args ) && $args['field_options_wrapper'] ) { echo '
'; echo '
'; } } /** * Render checkbox field as sub-field of a toggle/switcher checkbox * * @since 1.9.0 */ function render_checkbox_plain( $args ) { $options = get_option( ASENHA_SLUG_U ); $field_name = $args['field_name']; $field_label = $args['field_label']; $field_option_value = ( isset( $options[$args['field_id']] ) ) ? $options[$args['field_id']] : false; echo ''; echo ''; } /** * Render checkbox field as sub-field of a toggle/switcher checkbox * * @since 1.3.0 */ function render_checkbox_subfield( $args ) { $options = get_option( ASENHA_SLUG_U ); $field_name = $args['field_name']; $field_label = $args['field_label']; $field_option_value = ( isset( $options[$args['parent_field_id']][$args['field_id']] ) ) ? $options[$args['parent_field_id']][$args['field_id']] : false; echo ''; echo ''; } /** * Render text field as sub-field of a toggle/switcher checkbox * * @since 1.4.0 */ function render_text_subfield( $args ) { $options = get_option( ASENHA_SLUG_U ); $field_id = $args['field_id']; $field_name = $args['field_name']; $field_type = $args['field_type']; $field_prefix = $args['field_prefix']; $field_suffix = $args['field_suffix']; $field_description = $args['field_description']; $field_option_value = ( isset( $options[$args['field_id']] ) ) ? $options[$args['field_id']] : ''; if ( $field_id == 'custom_login_slug' ) { $placeholder = 'e.g. backend'; } elseif ( $field_id == 'redirect_after_login_to_slug' ) { $placeholder = 'e.g. my-account'; } elseif ( $field_id == 'redirect_after_logout_to_slug' ) { $placeholder = 'e.g. come-visit-again'; } else {} echo $field_prefix . '' . $field_suffix; echo ''; } /** * Render sortable menu field * * @since 2.0.0 */ function render_sortable_menu( $args ) { ?>
Drag and drop menu items to the desired position and optionally hide them until "Show All" at the bottom of the admin menu is clicked.
'; $field_id = 'custom_menu_hidden'; $field_name = ASENHA_SLUG_U . '['. $field_id .']'; $field_option_value = ( isset( $options[$field_id] ) ) ? $options[$field_id] : ''; // Hidden input field to store hidden menu itmes (from options as is, or 'Hide' checkbox clicks) upon clicking Save Changes. echo ''; } }