Skip to content

Commit

Permalink
Query Block: Remove redundant sticky state (WordPress#66126)
Browse files Browse the repository at this point in the history
Co-authored-by: tyxla <[email protected]>
Co-authored-by: ciampo <[email protected]>
  • Loading branch information
3 people authored and karthick-murugan committed Nov 13, 2024
1 parent e5e0c00 commit 6829163
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,14 @@ export default function QueryInspectorControls( props ) {
format,
} = query;
const allowedControls = useAllowedControls( attributes );
const [ showSticky, setShowSticky ] = useState( postType === 'post' );
const showSticky = postType === 'post';
const {
postTypesTaxonomiesMap,
postTypesSelectOptions,
postTypeFormatSupportMap,
} = usePostTypes();
const taxonomies = useTaxonomies( postType );
const isPostTypeHierarchical = useIsPostTypeHierarchical( postType );
useEffect( () => {
setShowSticky( postType === 'post' );
}, [ postType ] );
const onPostTypeChange = ( newValue ) => {
const updateQuery = { postType: newValue };
// We need to dynamically update the `taxQuery` property,
Expand Down

0 comments on commit 6829163

Please sign in to comment.