Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter furilla

    (@furilla)

    Works perfectly… I used the following shortcode:

    [shortcode-weather-atlas city_selector=2358376  layout=”Vertical” background_color=”rgba(30,115,190,0.96)” daily=5]

    The way I set it up was to place it first in the widget, Put in the city then grab the shortcode to place it on a page. I actually kept the one in the widget but you could remove it after you get the shortcode.

    Thread Starter furilla

    (@furilla)

    Regarding Chester’s outstanding support: I would like to say that Chester could not have been more helpful in getting me through this problem. Working with him was nothing short of excellent.

    Thanks very much,
    Ed

    Thread Starter furilla

    (@furilla)

    • This reply was modified 6 years, 11 months ago by furilla.
    Thread Starter furilla

    (@furilla)

    That worked perfectly. Thanks so much.

    I don’t want to put in a fixed name and email address. Can I prefill the current user display name. If so, What is the syntax for doing that.

    I want to Capture the current wordpress user display name and email address.

    • This reply was modified 6 years, 11 months ago by furilla.
    • This reply was modified 6 years, 11 months ago by furilla.
    Thread Starter furilla

    (@furilla)

    Thanks, i think i am getting closer but I am still not able to pass the information i need to the form.

    I have added the following code to the files in WordPress. I must be missing something as I am not getting the prefilled field. Am I suppose to be adding something to the WordPress page to indicate what to prefill?

    WordPress (embedded code from airtable)
    <iframe class=”airtable-bed” style=”background: transparent; border: 1px solid #ccc;” src=”https://airtable.com/embed/shrRMSNCSSaPw8BDG?backgroundColor=blue&#8221; width=”100%” height=”533″ frameborder=”0″></iframe>

    Functions.php (added at end of file)

    <?php
    // [airtableform form_id=”shrRMSNCSSaPw8BDG” color=”blue”]
    function airtableform_func( $atts ) {
    $a = shortcode_atts( array(
    ‘form_id’ => ”,
    ‘width’ => ‘100%’,
    ‘height’ => ‘533’,
    ‘color’ => ‘red’,
    ), $atts );
    $current_user = wp_get_current_user();
    $prefill_string = “”;
    if ( $current_user->exists() ) {
    $prefill = [
    “Name” => $current_user->user_login,
    “user_email” => $current_user->user_email
    ];
    foreach($prefill as $key => $value){
    $prefill_string .= “&prefill_” . rawurlencode($key) . “=” . rawurlencode($value);
    }
    }
    return ‘<iframe class=”airtable-embed” src=”https://airtable.com/embed/&#8217; . $a[“form_id”] . ‘?backgroundColor=’ . $a[“color”] . $prefill_string . ‘” frameborder=”0″ onmousewheel=”” width=”‘ . $a[“width”] . ‘” height=”‘ . $a[“height”] . ‘” style=”background: transparent; border: 1px solid #ccc;”></iframe>’;
    }
    add_shortcode( ‘airtableform’, ‘airtableform_func’ );

    Thread Starter furilla

    (@furilla)

    My Appologies. Thanks
    Ed

    I have had the same issue. I installed the classic editor and it worked perfectly. I am not happy with the solution as I can’t leverage the new editor but at least I got it going.

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