Skip to content

Instantly share code, notes, and snippets.

@bonny
Created October 3, 2012 21:50
Show Gist options
  • Select an option

  • Save bonny/3830100 to your computer and use it in GitHub Desktop.

Select an option

Save bonny/3830100 to your computer and use it in GitHub Desktop.
/**
* get all values or just the from a field in a field group
* @param $post_id
* @param $field_name_or_id name as string or field group id and field id as array.
* for example array(3,2) to fetch field 2 from field group 3
* @param $single bool return a single (the first) value or all values (as array)
* @return string or array
*/
simple_fields_get_post_value($post_id, $field_name_or_id, $single = true)
/**
* get all values from a field group
* @param int $post_id
* @param name or ir $field_group_name_or_id
* @param bool use_name return array with names or id as key
* @param int $return_format 1|2
* @return array
*/
simple_fields_get_post_group_values($post_id, $field_group_name_or_id, $use_name = true, $return_format = 1)
/**
* get all values from a field group
* @param int $post_id
* @param name or ir $field_group_name_or_id
* @param bool use_name return array with names or id as key
* @param int $return_format 1|2
* @return array
*/
simple_fields_get_post_group_values($post_id, $field_group_name_or_id, $use_name = true, $return_format = 1)
/**
* fetch all information about the field group that a post has
* returns connector structure, field groups, fields, and values
* well.. everything! it's really funky.
* return @array a really fat one!
*/
function simple_fields_get_all_fields_and_values_for_post($post_id)
@bonny

bonny commented Oct 3, 2012

Copy link
Copy Markdown
Author

Does comments show up on the embeded gist anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment