Skip to content

Commit f0cb5ea

Browse files
committed
Added wp_api_v2_ prefix to find_object_by_id function
1 parent 2a5e8c9 commit f0cb5ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wp-rest-api-v2-menus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function wp_api_v2_menus_dna_test( &$parents, $child ) {
116116
/**
117117
* Search object in an array by ID
118118
*/
119-
function find_object_by_id( $array, $id ) {
119+
function wp_api_v2_find_object_by_id( $array, $id ) {
120120
foreach ( $array as $element ) {
121121
if ( $id == $element->ID ) {
122122
return $element;
@@ -187,7 +187,7 @@ function wp_api_v2_menus_get_menu_items( $id ) {
187187
// push child items into their parent item in the original object
188188
do {
189189
foreach($child_items as $key => $child_item) {
190-
$parent = find_object_by_id( $all_menu_items, $child_item->menu_item_parent );
190+
$parent = wp_api_v2_find_object_by_id( $all_menu_items, $child_item->menu_item_parent );
191191

192192
if ( empty( $parent ) ) {
193193
unset($child_items[$key]);

0 commit comments

Comments
 (0)