hm-core.functions.php
/**
 * Gets an array of a specified property from an array of objects. Eg, returns all IDs of $wp_query->posts when passed 'ID'.
 *
 * @param array $array
 * @param string $property
 * @return array
 */
Gets an array of a specified property from an array of objects. Eg, returns all IDs of $wp_query->posts when passed 'ID'.
Gets an array of a specified property from an array of objects . Eg returns all IDs of $wp_query - > posts when passed ' ID ' .
function hm_get_object_properties_from_array( $array, $property ) {
	if ( !is_array( $array ) )
		return array();
	$properties = array();
	foreach ( $array as $value ) {
		$value = (object) $value;
		if ( isset( $value->$property ) )
			$properties[] = $value->$property;
	}
	return $properties;
}
function hm_get_object_properties_from_array ( $ array , $ property ) { if ( ! is_array ( $ array ) ) return array ( ) ; $ properties = array ( ) ; foreach ( $ array as $ value ) { $ value = ( object ) $ value ; if ( isset ( $ value -> $ property ) ) $ properties [ ] = $ value -> $ property ; } return $ properties ; }
Gets an array of a specified property from an array of objects.
Gets an array of a specified property from an array of objects .