'; 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, array() ); $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, array() ); $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, array() ); $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 ( ! empty( $field_prefix ) && ! empty( $field_suffix ) ) { $field_classname = ' with-prefix with-suffix'; } elseif ( ! empty( $field_prefix ) && empty( $field_suffix ) ) { $field_classname = ' with-prefix'; } elseif ( empty( $field_prefix ) && ! empty( $field_suffix ) ) { $field_classname = ' with-suffix'; } else { $field_classname = ''; } 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'; } elseif ( $field_id == 'login_fails_allowed' ) { $placeholder = '3'; } elseif ( $field_id == 'login_lockout_maxcount' ) { $placeholder = '3'; } else { $placeholder = ''; } echo $field_prefix . '' . $field_suffix; echo ''; } /** * Render textarea field as sub-field of a toggle/switcher checkbox * * @since 2.3.0 */ function render_textarea_subfield( $args ) { $options = get_option( ASENHA_SLUG_U, array() ); $field_id = $args['field_id']; $field_slug = $args['field_slug']; $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']] : ''; echo '
'; echo ''; if ( ! empty( $field_description ) ) { echo '
' . wp_kses_post( $field_description ) . '
'; } echo '
'; } /** * Render sortable menu field * * @since 2.0.0 */ function render_sortable_menu( $args ) { ?>
Drag and drop menu items to the desired position. Optionally change item titles or hide some items until "Show All" at the bottom of the admin menu is clicked.
'; $field_id = 'custom_menu_titles'; $field_name = ASENHA_SLUG_U . '['. $field_id .']'; $field_option_value = ( isset( $options[$field_id] ) ) ? $options[$field_id] : ''; // Hidden input field to store custom menu titles (from options as is, or custom values entered on each non-WP-default menu items. echo ''; $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 ''; } /** * Render textarea field as sub-field of a toggle/switcher checkbox * * @since 2.3.0 */ function render_datatable( $args ) { global $wpdb; $options = get_option( ASENHA_SLUG_U, array() ); $field_id = $args['field_id']; $field_slug = $args['field_slug']; $field_name = $args['field_name']; $field_type = $args['field_type']; $field_description = $args['field_description']; $table_title = $args['table_title']; $table_name = $args['table_name']; $field_option_value = ( isset( $options[$args['field_id']] ) ) ? $options[$args['field_id']] : ''; ?> prepare( "SELECT * FROM {$table_name} ORDER BY unixtime DESC LIMIT %d", array( $limit ) ); $entries = $wpdb->get_results( $sql, ARRAY_A ); foreach( $entries as $entry ) { $unixtime = $entry['unixtime']; if ( function_exists( 'wp_date' ) ) { $date = wp_date( 'F j, Y', $unixtime ); $time = wp_date( 'H:i:s', $unixtime ); } else { $date = date_i18n( 'F j, Y', $unixtime ); $time = date_i18n( 'H:i:s', $unixtime ); } ?>
IP Address
Last Username
Attempts
Lockouts
Last Attempt On



'; } }