-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refresh: Implement 'the_block_template_html' filter for the block template #6533
base: trunk
Are you sure you want to change the base?
Changes from all commits
8a85987
cc87df3
ec9a2ff
36fa8bf
b42de40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,6 +30,7 @@ class WP_Embed { | |||||
*/ | ||||||
public function __construct() { | ||||||
// Hack to get the [embed] shortcode to run before wpautop(). | ||||||
add_filter( 'the_block_template_html', array( $this, 'run_shortcode' ), 6 ); | ||||||
add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); | ||||||
add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 ); | ||||||
add_filter( 'widget_block_content', array( $this, 'run_shortcode' ), 8 ); | ||||||
|
@@ -38,6 +39,7 @@ public function __construct() { | |||||
add_shortcode( 'embed', '__return_false' ); | ||||||
|
||||||
// Attempts to embed all URLs in a post. | ||||||
add_filter( 'the_block_template_html', array( $this, 'autoembed' ), 6 ); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we go with my other suggestion on adjusting the shortcode filter priorities, we could align this:
Suggested change
|
||||||
add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); | ||||||
add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 ); | ||||||
add_filter( 'widget_block_content', array( $this, 'autoembed' ), 8 ); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -603,6 +603,14 @@ | |||||||||
// Global styles custom CSS. | ||||||||||
add_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles_custom_css' ); | ||||||||||
|
||||||||||
// Block template. | ||||||||||
add_filter( 'the_block_template_html', 'shortcode_unautop', 7 ); | ||||||||||
add_filter( 'the_block_template_html', 'do_shortcode', 8 ); | ||||||||||
Comment on lines
+607
to
+608
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this maintains the original order of the function, I wonder whether we could align this with the filter order execution on the other similar scenarios, e.g. on I know this comment is a bit opposite of my other comment, but I'm purely throwing it out there for consideration. I wonder why it was even decided in the first place to use a different order here. On another note: If we used
Suggested change
|
||||||||||
add_filter( 'the_block_template_html', 'do_block_template_blocks', 9 ); | ||||||||||
add_filter( 'the_block_template_html', 'wptexturize' ); | ||||||||||
add_filter( 'the_block_template_html', 'wp_filter_content_tags' ); | ||||||||||
Comment on lines
+610
to
+611
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having the order of these two purely defined by the order of these two
Suggested change
|
||||||||||
add_filter( 'the_block_template_html', 'convert_smilies', 20 ); | ||||||||||
Comment on lines
+611
to
+612
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the original code that is being changed here, But if we don't feel strongly, it would be safer to leave out the priority on
Suggested change
|
||||||||||
|
||||||||||
// Block supports, and other styles parsed and stored in the Style Engine. | ||||||||||
add_action( 'wp_enqueue_scripts', 'wp_enqueue_stored_styles' ); | ||||||||||
add_action( 'wp_footer', 'wp_enqueue_stored_styles', 1 ); | ||||||||||
|
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.
If we go with my other suggestion on adjusting the shortcode filter priorities, we could align this: