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
46 changes: 12 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/edit-post/src/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MenuItem } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
import { addQueryArgs } from '@wordpress/url';

/**
* Internal dependencies
Expand All @@ -22,7 +23,7 @@ registerPlugin( 'edit-post', {
<Fragment>
<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 @@ -32,6 +32,7 @@ import {
import { withDispatch, withSelect } from '@wordpress/data';
import { withInstanceId, compose, withSafeTimeout } from '@wordpress/compose';
import { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } from '@wordpress/keycodes';
import { addQueryArgs } from '@wordpress/url';

/**
* Internal dependencies
Expand Down Expand Up @@ -323,7 +324,7 @@ export class InserterMenu extends Component {
<BlockTypesList items={ reusableItems } onSelect={ onSelect } onHover={ this.onHover } />
<a
className="editor-inserter__manage-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
>
{ __( 'Manage All Reusable Blocks' ) }
</a>
Expand Down