Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter BlogLogistics

    (@ac2a)

    For anyone finding this thread, and needing fast help to get this done. Here is the updated code to the …/contact-form7/modules/turnstile/turnstile.php

    /**
     * The Turnstile form-tag handler.
     */
    function wpcf7_turnstile_form_tag_handler( $tag ) {
    $service = WPCF7_Turnstile::get_instance();

    if ( ! $service->is_active() ) {
    return;
    }

    return sprintf(
    '<div %s></div>',
    wpcf7_format_atts( array(
    'class' => 'wpcf7-turnstile cf-turnstile',
    'data-sitekey' => $service->get_sitekey(),
    'data-action' =>
    $tag->get_option( 'action', '[-0-9a-zA-Z_]{1,32}', true ),
    'data-size' =>
    $tag->get_option( 'size', '(normal|flexible|compact)', true ),
    // Add the following line for the theme option
    'data-theme' =>
    $tag->get_option( 'theme', '(light|dark|auto)', true ),
    'data-response-field-name' => '_wpcf7_turnstile_response',
    ) )
    );
    }

    How to Use the New Option…

    With this change in place, you can now use the theme option in your Contact Form 7 form editor like this:

    • For a dark theme:[turnstile theme:dark]
    • For a light theme:[turnstile theme:light]

    I hope in some small way this helps someone.

    Update: Make a backup of the original, before editing 😉

    • This reply was modified 9 months, 3 weeks ago by BlogLogistics. Reason: Added note to backup before editing CF7 files
    Thread Starter BlogLogistics

    (@ac2a)

    Sorry, I posted to the wrong place. It should be: https://wordpress.org/support/plugin/contact-form-7/

    I don’t see an option to move this. Can a moderator help out here please?

    Thanks.

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

The topic ‘[turnstile theme:light] ?’ is closed to new replies.