All features

Cherry Blossom feature

Structured data: Merger

Merges theme entities into an existing schema graph.

Merges theme entities into an existing schema graph.

Capabilities and extension points

Merges schema graphs and combines compatible FAQ pages.

FAQ pages with valid questions are combined into the first such page. Its properties win on overlap, while duplicate questions are removed. Other entities remain separate; colliding graph keys receive unique keys. Non-array graph arguments are treated as empty arrays.

  • param mixed $existing Existing schema graph.
  • param mixed $additional Additional theme entities.
  • return array Merged schema graph.

Determines whether an entity is an FAQ page.

  • param array $entity Schema entity.
  • return bool Whether the entity is an FAQ page.

Normalizes and deduplicates an FAQ page.

  • param array $entity FAQ page entity.
  • param array $questions Valid question nodes and references.
  • return array Normalized FAQ page.

Merges one FAQ page into another.

  • param array $existing Existing FAQ page.
  • param array $additional Additional FAQ page.
  • param array $questions Valid questions from the additional FAQ page.
  • return array Merged FAQ page.

Gets questions from an FAQ page.

  • param array $entity FAQ page entity.
  • return array Questions.

Determines whether a value is a question node or graph reference.

  • param mixed $question Proposed question.
  • return bool Whether the value can be merged safely.

Removes duplicate FAQ questions while retaining their first occurrence.

  • param array $questions FAQ questions.
  • return array Deduplicated questions.

Creates a comparison fingerprint for an FAQ question and answer.

  • param array $question FAQ question.
  • return string Question fingerprint.

Normalizes schema text for comparison.

  • param mixed $text Schema text.
  • return string Normalized text.

Gets a graph key that does not overwrite an existing entity.

  • param array $entities Existing entities.
  • param int|string $key Proposed key.
  • return int|string Unique graph key.

Source reference

This editable reference page is based on the PHP documentation in structured-data/class-merger.php.