|
@@ 207-221 (lines=15) @@
|
| 204 |
|
$all_metaboxes = apply_filters( 'cmb2_meta_boxes', array() ); |
| 205 |
|
|
| 206 |
|
// Loop through all possible sets of metaboxes added the old way |
| 207 |
|
foreach ( $all_metaboxes as $metabox_array ) { |
| 208 |
|
|
| 209 |
|
// If the custom post type ID matches this set of fields, set & stop |
| 210 |
|
if ( in_array( $slug, $metabox_array['object_types'] ) ) { |
| 211 |
|
|
| 212 |
|
// If this is the first group of fields, simply set the value |
| 213 |
|
// Else, merge this group with the previous one |
| 214 |
|
if ( empty( $fields ) ) { |
| 215 |
|
$fields = $metabox_array['fields']; |
| 216 |
|
} else { |
| 217 |
|
$fields = array_merge( $fields, $metabox_array['fields'] ); |
| 218 |
|
} |
| 219 |
|
} |
| 220 |
|
|
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
// Loop through all metaboxes added the new way |
| 224 |
|
foreach ( \CMB2_Boxes::get_all() as $cmb ) { |
|
@@ 281-295 (lines=15) @@
|
| 278 |
|
$all_metaboxes = apply_filters( 'cmb_meta_boxes', array() ); |
| 279 |
|
|
| 280 |
|
// Loop through all possible sets of metaboxes |
| 281 |
|
foreach ( $all_metaboxes as $metabox_array ) { |
| 282 |
|
|
| 283 |
|
// If the custom post type ID matches this set of fields, set & stop |
| 284 |
|
if ( in_array( $slug, $metabox_array['pages'] ) ) { |
| 285 |
|
|
| 286 |
|
// If this is the first group of fields, simply set the value |
| 287 |
|
// Else, merge this group with the previous one |
| 288 |
|
if ( empty( $fields ) ) { |
| 289 |
|
$fields = $metabox_array['fields']; |
| 290 |
|
} else { |
| 291 |
|
$fields = array_merge( $fields, $metabox_array['fields'] ); |
| 292 |
|
} |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
// Identify Human Made's CMB library |
| 298 |
|
if ( defined( 'CMB_DEV' ) ) { |