Get post ancestors in the Block Editor
August 20, 2022 Update: For completeness, I added a JavaScript/Gutenberg solution which does what the findParent() function in question tries to do, i.e. find the top ancestor. You can find the code below the “Original Answer” section. Original Answer The block editor doesn’t (currently) have a function equivalent to get_post_ancestors(), and yes you could create … Read more