In short, I want to use the default_content filter to return slightly different content depending on if it will be used in the block editor or not (eg. the quicktags or tinymce editor) - is there any way I can tell from the default_content filter how the content will be used?
Lengthy version: I created a simple author signature (simple text field added via acf) that adds a signature to the bottom of a user's posts/comments via the default_content filter (ie. it adds it to the editor, so could be changed or removed). This worked fine in the classic editor, but not in the block editor, which by default puts that in a classic editor block. To solve that I made an author signature block, which works nicely for the block editor, and converts perfectly to the classic editor.
The issue I face is that in the classic editor I need to add an additional line break ('
') ahead of the signature, so it's clear where you should begin typing. (Without it you have to click on the on the signature line, hit enter, then move the cursor up.) If I leave that line break in for the block editor, it works wrong (the line break is turned into an html block with empty paragraph tags).
I have seen various ways to try to guess if the block editor or classic editor are in use on the site, but in this case they both are. Eg. I will edit a post with block editor, but comments use the classic editor. I have found a few hooks that are triggered for one editor or the other, but they all seem to run too late to be useful (after default_content).
So far I haven't found any way to determine what needs to be output from default_content, any thoughts?