Skip to content

Instantly share code, notes, and snippets.

@christianmagill
Last active October 27, 2016 18:09
Show Gist options
  • Save christianmagill/6c3f6c6a21133474b9d6b675b98eeba6 to your computer and use it in GitHub Desktop.
Save christianmagill/6c3f6c6a21133474b9d6b675b98eeba6 to your computer and use it in GitHub Desktop.
function acf_form_field_load( $field ) {
$field['choices'] = array();
$forms = RGFormsModel::get_forms( null, 'title' );
$field['choices'][''] = '- Select Form -';
foreach ( $forms as $form ) {
$field['choices'][ $form->id ] = $form->title;
}
return $field;
}
add_filter( 'acf/load_field/name=form', 'acf_form_field_load' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment