Check if in Cornerstone editor via PHP

Is there a way to check if we are currently in Cornerstone editor via PHP code, i.e. like is_cornerstone()?

Let’s say I want to a call a certain piece of code only in the front end. There are some functions like is_admin() and wp_doing_ajax() to check this.

It seems, when we are in Cornerstone editor, these checks do not work. Maybe there is something else I can check for to see if Cornerstone is currently running?

Best
René

$isPreview = did_action('cs_element_rendering');

Is probably what you are looking for. There are other examples on this doc page of extending the Cornerstone Preview. A is_cornerstone_preview function would be nice though. Have a great day.