get_duplicate_group()
Description
Returns An array of the specified Group(By given metaKey) with all field value.
Parameters
|
1 2 3 4 5 |
<?php
get_duplicate_group($metaKey,$post_id=null);
?> |
- $metaKey: The Meta key of the field . eg “book_info” (required)
- $post_id: Specific post ID where your value was entered. Defaults to current post ID(not required)
Usage
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<?php
$groups = get_duplicate_group(album,1); // By using All parameter
$groups1 = get_duplicate_group(album); // using metakey
if($groups){
/*
Displaying array value
*/
echo '<pre>';
print_r( $groups ); // For displaying All array value
echo '</pre>';
/*
For Field output
*/
foreach($groups as $group){
foreach($group as $fields){
if(is_array($fields)){
foreach($fields as $field){
echo $field;
}
}
}
}
} else{
// do something
}
?> |
Out Put
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
Array
(
[1] => Array
(
[post_1_1] => Array
(
[1] => 555
[2] => 66666666666
)
[post_1_2] => Array
(
[1] => 555
)
[post_1_3] => Array
(
[1] => 1
)
[post_1_4] => Array
(
[1] => 1
)
[post_1_5] => Array
(
[1] => 555
)
[post_1_6] => Array
(
[1] => 2012-10-16
)
)
[2] => Array
(
[post_1_1] => Array
(
[1] => 6666666666
)
[post_1_2] => Array
(
[1] => 6666666666
)
[post_1_3] => Array
(
[1] => 1
)
[post_1_4] => Array
(
[1] => 1
)
[post_1_5] => Array
(
[1] =>
)
[post_1_6] => Array
(
[1] =>
)
)
) |

