• Resolved Andre

    (@picturebreeze)


    I’ve used the shortcode [secure_passkeys_register_form] in Gutenberg.
    On the front-end it displays an h3 heading and a description text paragraph inside the div with ID=”passkey_app”, right before (above) the passkey registration button.

    Where/how can I change the text of that heading and the description paragraph?

    The shortcode block editor in Gutenberg doesn’t give me any options about the heading and description field.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mohamed Endisha

    (@endisha)

    @picturebreeze You can change them in one of three ways:

    Option 1: Filter (code): Add to your theme’s functions.php:

    add_filter('secure_passkeys_get_frontend_register_localization', function ($i18n) {
    $i18n['title'] = 'Your custom heading';
    $i18n['description'] = 'Your custom description paragraph.';
    return $i18n;
    });

    Option 2: gettext filter: Add to your theme’s functions.php:

    add_filter('gettext', function ($translated, $text, $domain) {
        if ($domain !== 'secure-passkeys') {
            return $translated;
        }
    
        if ($text === 'Passwordless sign-in with passkeys') {
            return 'Your custom heading here';
        }
    
        if (strpos($text, 'Passkeys offer a secure and user-friendly') === 0) {
            return 'Your custom description paragraph here.';
        }
    
        return $translated;
    }, 10, 3);

    Option 3: Translation (no code):

    Install Loco Translate plugin, open Secure Passkeys, and edit these two source strings:

    • Passwordless sign-in with passkeys
    • Passkeys offer a secure and user-friendly authentication method…
    Thread Starter Andre

    (@picturebreeze)

    Thank you so much. Also for the great and free plugin.

    Option #1 works great for me.

    Plugin Author Mohamed Endisha

    (@endisha)

    @picturebreeze Glad it helped. If you think it deserves it, a positive rating would be appreciated and would help support the plugin’s continued development.

    Solved 👍

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.