Last active
July 26, 2016 09:44
-
-
Save marcjenkins/56cff7b182564d74f6e862a94abdf9d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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