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

Style engine: refer to 'context' rather than 'store' in global function #43841

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Sep 5, 2022

What?

Renames user-facing method wp_style_engine_get_stylesheet_from_store to wp_style_engine_get_stylesheet_from_context since it matches the incoming option parameter 'context'

Props to @noisysocks for the nudge

Why?

So that the fetching method matches the context option.

Also, the assumption is that 'store' is not meaningful on its own.

	// Register block supports styles.
	wp_style_engine_get_styles(
		$block_styles,
		array(
			'selector' => ".$class_name",
			'context'  => 'block-supports', // context!!!
		)
	);

	// Fetch block supports styles from context store.
	$styles = wp_style_engine_get_stylesheet_from_context( 'block-supports' );

Testing Instructions

The tests should pass.

… to `wp_style_engine_get_stylesheet_from_context` since it matches the incoming option parameter 'context'
@ramonjd ramonjd added [Type] Code Quality Issues or PRs that relate to code quality [Package] Style Engine /packages/style-engine labels Sep 5, 2022
@ramonjd ramonjd self-assigned this Sep 5, 2022
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@ramonjd ramonjd merged commit c5e2734 into trunk Sep 5, 2022
@ramonjd ramonjd deleted the update/style-engine-rename-store-to-context branch September 5, 2022 22:35
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 5, 2022
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Sep 21, 2022
@ramonjd ramonjd removed the Needs Dev Note Requires a developer note for a major WordPress release cycle label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Style Engine /packages/style-engine [Type] Code Quality Issues or PRs that relate to code quality
Projects
Status: 🏆 Done
Development

Successfully merging this pull request may close these issues.

3 participants