Skip to content

Instantly share code, notes, and snippets.

@marcjenkins
Last active July 26, 2016 09:44
Show Gist options
  • Save marcjenkins/56cff7b182564d74f6e862a94abdf9d2 to your computer and use it in GitHub Desktop.
Save marcjenkins/56cff7b182564d74f6e862a94abdf9d2 to your computer and use it in GitHub Desktop.
<?php
/**
* Shortcode for getting ACF option field
* Usage:
* [options field="tel"]
*/
function origin_sc_acf_option_field( $atts ) {
extract( shortcode_atts( array(
'field' => 'field'
), $atts ) );
$value = get_field( $field, 'options' );
if ( $value ):
return $value;
endif;
}
add_shortcode( 'options', 'origin_sc_acf_option_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment