public function apply_builder_in_content($content) { // Remove the filter itself in order to allow other `the_content` in the elements remove_filter('the_content', [$this, 'apply_builder_in_content']); if (!$this->_is_frontend_mode) { return $content; } $post_id = get_the_ID(); $builder_content = $this->get_builder_content($post_id); if (!empty($builder_content)) { $content = $builder_content; } // Add the filter again for other `the_content` calls add_filter('the_content', [$this, 'apply_builder_in_content']); return $content; }