• Hello, this plugin is really great. I needed a contact form for a product catalogue which informs me what product the information sent is refering too, so this works great. I just would like to know if its possible to also add values from custom fields that are specified in each post. what code would i need to add a custom field that i created?

    Thank you for your help!!

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author sevenspark

    (@sevenspark)

    This functionality is now available in version 1.0.4. The tag would look like this:

    [dynamictext dynamicname "CF7_get_custom_field key='my_custom_field'"]

    Glad you like the plugin!

    Thread Starter salatfresser

    (@salatfresser)

    Works perfectly, thanks a ton!!!

    julianislief

    (@julianislief)

    Is it posible to get a php variable, like this:

    <?php
    $thisisavariable = "hello world";
    echo $thisisavariable;
    ?>

    Can i put $thisisavariable in a dynamic field?

    Plugin Author sevenspark

    (@sevenspark)

    It depends on scope. All the values are created through shortcodes, which are each defined by a function. The variable would have to be within the scope of that function in order to return it. If your variable is global, you’d be good to go. Alternatively, you could just call and return the function that generates the value of your variable within the shortcode function.

    In any event, I’m sure there’s a way to do what you want, but you’ll need to write a new shortcode for it most likely.

    Hope that helps,

    Chris

    julianislief

    (@julianislief)

    Hello Chris,

    Thank you for the quik reply!

    i have made a shortcode in functions.php

    //Shortcode CF7 DT variabelen
    
    function offer() {
        $bodnr = $_GET['comid'];
    	$bodinfo = get_comment($bodnr);
    	$bodcontent = $bodinfo->comment_content;
    	return $bodcontent;
    }
    add_shortcode('of', 'offer');

    In the form i put the next code:

    <p> [dynamictext* test "CF7_GET key='of'"]</p>

    But i don’t get the output! When i put [of] into the texteditor of Worpress i get the right output.

    What i am doing wrong?

    Thanks for your effort!
    When i put [of] in the texteditor i get the right output, b

    Plugin Author sevenspark

    (@sevenspark)

    You’re almost there. The CF7 dynamictext tag you wrote is using the CF7_GET shortcode which is looking for a GET variable named ‘of’. Your case is simpler ??

    Try this:

    [dynamictext* test "of"]

    Whatever is in quotes is executed as a shortcode. key is the parameter passed to the CF7_GET shortcode.

    Chris

    julianislief

    (@julianislief)

    Whahoooo!!!!
    Thank you so much Chris!
    It works, your the best!

    Again Thank you very much for your support and the great plugin your made!

    Plugin Author sevenspark

    (@sevenspark)

    You’re welcome! Glad we got it worked out for you ??

    julianislief

    (@julianislief)

    5 stars for you and your plugin!

    julianislief

    (@julianislief)

    Sorry, here i am again, with the next question:
    de next code i have but won’t work:
    Shortcode:

    //Shortcode test Geert
    
    function hello() {
            $val = $_GET['thevariable'];
    	$user = new WP_User( $val );
    	$user_info = get_userdata($val);
    	echo($user_info->display_name);
    }
    add_shortcode('bn', 'hello');

    and the code for the form:
    <p>[dynamictext* test "bn"]</p>

    What am i doing wrong?

    Plugin Author sevenspark

    (@sevenspark)

    You need to return not echo.

    julianislief

    (@julianislief)

    Thankzz, how stupid of me!

    julianislief

    (@julianislief)

    oeef here i’m again, with the next question, why won’t work the next code:

    /Shortcode koper straat
    
    function koper_street() {
        $val_kos = $_GET['foo'];
    	$wat = 'aim';
    	$user_info_kos = the_author_meta( $wat ,$val_kos );
    	return $user_info_kos;
    }
    add_shortcode('kos', 'koper_street');

    and the code in the form
    <p>[dynamictext* street "kos"]</p>

    Plugin Author sevenspark

    (@sevenspark)

    the_author_meta prints the value and doesn’t return anything.

    Use get_the_author_meta instead.

    julianislief

    (@julianislief)

    thankzz!!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘[Plugin: Contact Form 7 Dynamic Text Extension] applying custom keys’ is closed to new replies.