Directory

Update documentation for setGroupingBlockName by aurooba · Pull Request #49670 · WordPress/gutenberg · GitHub
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

Update documentation for setGroupingBlockName #49670

Merged

Conversation

aurooba
Copy link
Member

@aurooba aurooba commented Apr 8, 2023

What?

The inline documentation for the function setGroupingBlockName had incorrect helper text. This update the button text in the Example Component to indicate what passing core/columns to setGroupingBlockName would actually do.

Why?

The current documentation for this function is confusing since it was probably pulled from the documentation of a different function.

How?

This updates the wording and adds a bit more explainer text to make this easier to understand.

Here's the change:

Assigns name of block for handling block grouping interactions.

This function lets you select a different block to group other blocks in instead of the
default core/group block. This function must be used in a component or when the DOM is fully
loaded. See https://developer.wordpress.org/block-editor/reference-guides/packages/packages-dom-ready/

@param {string} name Block name.

@example

import { setGroupingBlockName } from '@wordpress/blocks';

const ExampleComponent = () => {

    return (
        <Button onClick={ () => setGroupingBlockName( 'core/columns' ) }>
            { __( 'Wrap in columns' ) }
        </Button>
    );
};

Add extra explainer text on what setGroupingBlockName does and that it needs to be executed once the DOM is fully loaded.
@aurooba aurooba marked this pull request as ready for review April 8, 2023 21:43
@alexstine
Copy link
Contributor

@aurooba Could you please fix up and commit this error?

https://github.com/WordPress/gutenberg/actions/runs/4647241856/jobs/8224124943?pr=49670

Thanks.

@aurooba
Copy link
Member Author

aurooba commented Apr 9, 2023

@alexstine Thanks for the nudge! I forgot I have to run the docs command. 😅 Should be good now.

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Thanks for this fix to the docs :)

@fabiankaegy fabiankaegy merged commit 7810f7b into WordPress:trunk Apr 9, 2023
48 checks passed
@github-actions github-actions bot added this to the Gutenberg 15.6 milestone Apr 9, 2023
@bph bph added the [Type] Developer Documentation Documentation for developers label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants