add_filter( 'gform_pre_render_1', 'populate_posts' );
add_filter( 'gform_pre_validation_1', 'populate_posts' );
add_filter( 'gform_pre_submission_filter_1', 'populate_posts' );
add_filter( 'gform_admin_pre_render_1', 'populate_posts' );
function populate_posts( $form ) {
foreach ( $form['fields'] as &$field )
{
if ( $field->type != 'select') {
continue;
}
$choices = array();
$choices = $field->choices;
$choices[] = array( 'text' => 'Australia', 'value' => 'australia' );
$choices[] = array( 'text' => 'Canada', 'value' => 'canada' );
$field->placeholder = 'Choose a country';
$field->choices = $choices;
}
return $form;
}