Skip to content

Commit

Permalink
Add helpful text to Query Loop block (#32694)
Browse files Browse the repository at this point in the history
* Update and expand block descriptions for Query and Post Template.

* Add helpful text explaining the different intricate parts of a WP query.

The goal is to introduce users to some of the more obscure concepts
that come with WordPress, making the Query block a paving stone
for more advanced usage of the software.
  • Loading branch information
mtias authored Jun 16, 2021
1 parent 79818ec commit 569e24d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-template/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "Post Template",
"category": "design",
"parent": [ "core/query" ],
"description": "Post Template.",
"description": "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
"textdomain": "default",
"usesContext": [
"queryId",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/query/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "core/query",
"title": "Query Loop",
"category": "design",
"description": "Displays a list of posts as a result of a query.",
"description": "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
"textdomain": "default",
"attributes": {
"queryId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export default function QueryInspectorControls( {
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<ToggleControl
label={ __( 'Inherit query from URL' ) }
label={ __( 'Inherit query from template' ) }
help={ __(
'Disable the option to customize the query arguments. Leave enabled to inherit the global query depending on the URL.'
'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'
) }
checked={ !! inherit }
onChange={ ( value ) => setQuery( { inherit: !! value } ) }
Expand All @@ -191,6 +191,9 @@ export default function QueryInspectorControls( {
value={ postType }
label={ __( 'Post Type' ) }
onChange={ onPostTypeChange }
help={ __(
'WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.'
) }
/>
) }
{ displayLayout?.type === 'flex' && (
Expand Down Expand Up @@ -230,6 +233,9 @@ export default function QueryInspectorControls( {
options={ stickyOptions }
value={ sticky }
onChange={ ( value ) => setQuery( { sticky: value } ) }
help={ __(
'Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'
) }
/>
) }
</PanelBody>
Expand Down

0 comments on commit 569e24d

Please sign in to comment.