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

Using addQueryArgs to generate Manage All Reusable Blocks link #10065

Closed
3 changes: 2 additions & 1 deletion edit-post/components/header/more-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { __, _x } from '@wordpress/i18n';
import { IconButton, Dropdown, MenuGroup, MenuItem } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { addQueryArgs } from '@wordpress/url';

/**
* Internal dependencies
Expand Down Expand Up @@ -40,7 +41,7 @@ const MoreMenu = () => (
>
<MenuItem
role="menuitem"
href="edit.php?post_type=wp_block"
href={ addQueryArgs( 'edit.php', { post_type: 'wp_block' } ) }
>
{ __( 'Manage All Reusable Blocks' ) }
</MenuItem>
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { withSpokenMessages, PanelBody, IconButton } from '@wordpress/components
import { getCategories, isReusableBlock } from '@wordpress/blocks';
import { withDispatch, withSelect } from '@wordpress/data';
import { withInstanceId, compose, withSafeTimeout } from '@wordpress/compose';
import { addQueryArgs } from '@wordpress/url';

/**
* Internal dependencies
Expand Down Expand Up @@ -290,7 +291,7 @@ export class InserterMenu extends Component {
className="editor-inserter__manage-reusable-blocks"
icon="admin-generic"
label={ __( 'Manage All Reusable Blocks' ) }
href="edit.php?post_type=wp_block"
href={ addQueryArgs( 'edit.php', { post_type: 'wp_block' } ) }
gziolo marked this conversation as resolved.
Show resolved Hide resolved
/>
</PanelBody>
) }
Expand Down