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

Make Query Loop settings more intuitive with a ToggleGroup and simplified help text #63739

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update controls description in Queryn Loop block
  • Loading branch information
kmanijak committed Jul 26, 2024
commit 11dd2e9cc5fa6c0a0656aa82b71eb20559495097
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,18 @@ export default function QueryInspectorControls( props ) {
return onChangeDebounced.cancel;
}, [ querySearch, onChangeDebounced ] );
const showInheritControl = isControlAllowed( allowedControls, 'inherit' );
const inheritControlLabel = __( 'Contents' );
const inheritControlHelp = __(
"Block will display items matching the page's context, e.g. category archive or search result"
const inheritControlLabel = __( 'Query Type' );
const inheritControlDefaultHelp = __(
'Display a list of posts or custom post types based on the current template.'
richtabor marked this conversation as resolved.
Show resolved Hide resolved
);
const inheritControlCustomHelp = __(
'Display a list of posts or custom post types based on specific criteria.'
richtabor marked this conversation as resolved.
Show resolved Hide resolved
);
const showPostTypeControl =
! inherit && isControlAllowed( allowedControls, 'postType' );
const postTypeControlLabel = __( 'Content type' );
const postTypeControlLabel = __( 'Post type' );
const postTypeControlHelp = __(
'WordPress contains different types of content you can filter by. Posts and pages are the default types, but plugins could add more.'
'Select the type of content to display: posts, pages, or custom post types.'
);
const showColumnsControl = false;
const showOrderControl =
Expand Down Expand Up @@ -155,7 +158,11 @@ export default function QueryInspectorControls( props ) {
onChange={ ( value ) => {
setQuery( { inherit: !! value } );
} }
help={ inherit && inheritControlHelp }
help={
inherit
? inheritControlDefaultHelp
: inheritControlCustomHelp
}
value={ !! inherit }
>
<ToggleGroupControlOption
Expand Down
Loading