Skip to content

Instantly share code, notes, and snippets.

@traversal
Created June 19, 2015 04:15
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 traversal/218fd5c55bf38f91651f to your computer and use it in GitHub Desktop.
Save traversal/218fd5c55bf38f91651f to your computer and use it in GitHub Desktop.
Checkbox Selections
<?php
global $wf;
// suppose you have a post of type "family", slug "smith-family", with field set "details", and field "education_levels"
$selections = $wf->family( "smith-family" )->details->education_levels->selections();
// $selections is now a value-label pair of the current selections.
// to get just the labels, then use array_values like so...
$labels = array_values ( $selections );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment