Created
October 8, 2014 03:39
-
-
Save traversal/6684b050d013b68e8c6c to your computer and use it in GitHub Desktop.
Getting an array of field set names
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 | |
// assuming you have a post type "logo", here is the code to get an array of set names for that type. | |
<?php | |
echo "<h2>Logo Field Sets</h2>"; | |
global $meow_provider; | |
$set_names = array(); | |
$sets = $meow_provider->post_type_field_sets("logo"); | |
foreach ($sets as $set) { | |
echo "<h1>Set:" . $set->name . "</h1>"; | |
echo "<h2>Fields</h2>"; | |
echo "<ul>"; | |
foreach ($set->fields() as $field) { | |
echo "<li>". $field->display_label() . " (" . $field->name . ")</li>"; | |
} | |
echo "</ul>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment