Support

Account

Home Forums Add-ons Options Page Combine Two PHP Scripts Reply To: Combine Two PHP Scripts

  • Hi,

    it’s simple, just create the variable first (to keep it clean) and then use it instead of the field name, like this:

    $username = 'John'; // get this yourself
    $dynamic_field_name = 'adwords_cost_for_' . $username;
    
    echo the_field($dynamic_field_name, 'option');