Last active
February 17, 2021 00:24
-
-
Save frankyonnetti/2dbd6f1df0f8a17aa6c3e447888d9500 to your computer and use it in GitHub Desktop.
WordPress - ACF expose fields #wordpress #acf
This file contains hidden or 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 | |
| $field_key = "field_582cd061fb8e4"; | |
| $field = get_field_object($field_key); | |
| if( $field ) { | |
| echo '<select name="' . $field['key'] . '">'; | |
| foreach( $field['choices'] as $k => $v ) { | |
| echo '<option value="' . $k . '">' . $v . '</option>'; | |
| } | |
| echo '</select>'; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment