Skip to content

Instantly share code, notes, and snippets.

@zachwills
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachwills/e4f794fa69a1facdcada to your computer and use it in GitHub Desktop.
Save zachwills/e4f794fa69a1facdcada to your computer and use it in GitHub Desktop.
Fieldmanager autocomplete w/ datasource
$datasource_speakers = new Fieldmanager_Datasource_Post( array(
'query_args' => array( 'post_type' => array( 'speaker' ) ),
'use_ajax' => true
) );
$fm = new Fieldmanager_Autocomplete( __( 'Speaker' ), array(
'name' => 'speakers',
'datasource' => $datasource_speakers,
'sortable' => true,
'limit' => 0,
'add_more_label' => __( 'Add speaker' ),
)
);
$fm->add_meta_box( 'Speakers', array( 'page' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment