Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pdewouters/b5fcc0ff9e48d76df08663343e1207e4 to your computer and use it in GitHub Desktop.
Save pdewouters/b5fcc0ff9e48d76df08663343e1207e4 to your computer and use it in GitHub Desktop.
MultilingualPress code
// /content/plugins/multilingualpress3/src/multilingualpress/Cache/NavMenuItemsSerializer.php
$menuItem = $postArray['menu_item'] ?? [];
foreach (self::MENU_ITEM_ALLOWED_PROPERTIES as list($property, $type, $default)) {
if (!isset($post->{$property})) {
$post->{$property} = $this->extractValue($menuItem, $property, $type, $default);
}
}
$this->unserialized[] = $post;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment