• I am developing a site and I am using my very basic knowledge of php to try and conquer Mount Everest. I was never supposed to be the developer, only the designer, and I am now in the deep end. Any help on this will greatly be appreciated…

    I am trying to dynamically populate a field using Gravity Forms, and the support there is GREAT, but takes time and I am running out of time, so I am trying anything at the moment.

    The function to dynamically populate a field :

    add_filter('gform_field_value_your_parameter', 'my_custom_population_function');
    function my_custom_population_function($value){
        return 'boom!';
    }

    This works and I get boom! in my field… Now I am calling the function like this :

    $unique_id = 'WP11003';
    my_custom_population_function($unique_id);'
    
    And here is the customised function :

    add_filter(‘gform_field_value_your_parameter’, ‘my_custom_population_function’);
    function my_custom_population_function($value){
    echo $value;
    return $value;
    }`

    Now what happens is that I get the correct value echoed, but nothing is returned to the form. If I put :

    $$test = 'WP11013';
    return $test;

    Then it works, but as soon as I try to return the value that was passed to this function it doesn’t work at all.

    I know this is very hard based on the snippet of code I gave, but any help will be really appreciated.

    Thanks in advance!

The topic ‘WordPress, Gravity Forms and php’ is closed to new replies.