Undefined offset: 0-wp-includes/meta.php:488 -Melding
You should change $parents[] to $parents in get_parents() function: $parents = get_metadata(‘post’, $post_id, WPKWP::$META_CHILD, false); if ($parents !== FALSE && count($parents) > 0) return $parents; return false; because get_metadata return array in this case. If the $post_id parameter is invalid, false is returned. If the meta value isn’t set, function return an empty array. Therefore, … Read more