How do I get the host paragraph when a paragraph is referenced in another paragraph?
If you look at the Paragraph class in the module, you will find a public method called getParentEntity that return the parent entity of a Paragraph instance.

So, if you do:

$parent = $paragraph-&gt;getParentEntity();

if (isset($parent)) {
  // Your stuff ...
}


You would have the parent entity in the $parent variable. You can chain the method if there is multiple nested paragraphs. I also suggest using the isset method on the $parent variable because I've encounter some weird issues where random paragraphs returns null.