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_Forms_Dynamic_Fields::toggle_for_password( array $password, array[] $blocks )

Adds a current password field and a toggle link button allowing the user to change their password


Parameters Parameters

$password

(array) (Required) Password field data as located by LLMS_Forms_Dynamic_Fields::find_block().

$blocks

(array[]) (Required) Array of WP_Block arrays.


Top ↑

Return Return

(array[])


Top ↑

Source Source

File: includes/forms/class-llms-forms-dynamic-fields.php

544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
private function toggle_for_password( $password, $blocks ) {
 
    // Add the toggle button.
    $blocks = $this->add_block(
        $blocks,
        array(
            'type'  => 'html',
            'id'    => 'llms-field-toggle--password',
            'value' => $this->get_toggle_button_html( '#password,#password_confirm,#llms-password-strength-meter,#password_current', $password[1]['attrs']['label'] ),
        ),
        $password[1]['attrs']['meter'] ? $password[0] + 1 : $password[0]
    );
 
    /**
     * Filters the settings used to create the dynamic password strength meter block
     *
     * @since 5.0.0
     *
     * @param array $settings Array or block attributes/settings.
     */
    $current_password = apply_filters(
        'llms_current_password_field_settings',
        array(
            'type'            => 'password',
            'id'              => 'password_current',
            'name'            => 'password_current',
            'label'           => sprintf( __( 'Current %s', 'lifterlms' ), $password[1]['attrs']['label'] ),
            'required'        => true,
            'disabled'        => true,
            'data_store_key'  => false,
            'wrapper_classes' => 'llms-visually-hidden-field',
        )
    );
    return $this->add_block( $blocks, $current_password, $password[0] - 1 );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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