Skip to content
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

Fix custom button block style so that its path is correctly provided #5321

Closed
wants to merge 2 commits into from

Conversation

felixarntz
Copy link
Member

  • The 'path' argument of wp_enqueue_block_style() needs to be used instead of wp_style_add_data(). The latter only works when using wp_register_style() or wp_enqueue_style().
  • The URL and path need to be provided using the same set of functions - preferably get_theme_file_uri() and get_theme_file_path(), so that they can be optionally overwritten in a child theme.
  • The wp_enqueue_block_style() function has its documentation improved to add the missing parameter.
  • A few empty lines were modified to no longer include tabs, which shouldn't be the case per WPCS.

Trac ticket: https://core.trac.wordpress.org/ticket/59466


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@@ -3154,6 +3154,7 @@ function wp_enqueue_stored_styles( $options = array() ) {
* @type string[] $deps Array of registered stylesheet handles this stylesheet depends on.
* @type string|bool|null $ver Stylesheet version number.
* @type string $media The media for which this stylesheet has been defined.
* @type string|null $path Absolute path to the stylesheet, so that it can potentially be inlined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should 'path' => null be added to the default args below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is needed.

@hellofromtonya
Copy link
Contributor

hellofromtonya commented Sep 28, 2023

@felixarntz I think the TT4 fix this needs to be fixed upstream in the TT4 repo as development is happening there https://github.com/WordPress/twentytwentyfour.

@felixarntz
Copy link
Member Author

@felixarntz felixarntz closed this Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants