Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Last active December 8, 2016 21:55
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 joelstransky/3c16d82fca90972ea8e75452991d4857 to your computer and use it in GitHub Desktop.
Save joelstransky/3c16d82fca90972ea8e75452991d4857 to your computer and use it in GitHub Desktop.
Display a single ACF field form view
<?php $field = get_field_object('field_123a456b78c90'); ?>
<?php acf_form( array('post_id' => 'new_post', 'form' => false, 'fields' => array('field_123a456b78c90'))); ?>
<?php
$field = get_field_object('field_123a456b78c90');
$field['value'] = null;
// alternatively you could call acf_render_field_wrap( $field ); to display the name and description as acf_form would
acf_render_field( $field );
?>
<?php $field['value'] = null; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment