-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter for preview interstitial markup #12463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the filter with the following sample and it worked correctly:
wp.hooks.addFilter( 'editor.interstitialMessage', 'myplugin/preview', function() {
return '<b>Post preview is being generated! 💃</b>';
} );
Would it be possible to add some docs to the filter?
@jorgefilipecosta You mean in the handbook? |
@swissspidy I don't know whether Jorge meant inline docs or in the handbook but this page would be a good spot for a note either way: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/filters/editor-filters.md :) |
Ugh. We really need to automate that stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter works great and the sample tests correctly. I think this is the right place to document the filter. The code looks great to me.
cc: @gziolo as he has a more high-level view on our extensibility efforts, and may have some comments on this new API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editor.interstitialMessage
- my only concern would be the name of this filter. it doesn't contain any information about the context. What do you think about:
editor.PostPreview.interstitialMarkup
It is referenced much often as markup
than message
in the PR.
|
I scheduled this PR for 4.8 (WordPress 5.0.2) as it is a new feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, thanks for iterations. It looks good to go 👍
Hey guys. I created a very simple plugin with 2 files only and without React to handle this: my-plugin.php
my-plugin.js
Of course it's not working and I'm still seeing the default Wordpress logo animation with the same text below it (otherwise I wouldn't be here). But my JS file is loaded successfully when loading Gutenberg Editor (I also added a
Thank you very much |
@leomuniz would you mind creating a new issue for this? Otherwise this gets easily lost |
Just opened. Tried to use as many as keywords possible to facilitate other people with similar problem: How to change or hide the Wordpress Animated Logo when loading a a post/page preview #16326 Thank you very much |
Description
This uses
applyFilters
to make the preview interstitial markup filterable.Fixes #12238.
Checklist: