Skip to content

Commit

Permalink
Using addQueryArgs to generate Manage All Reusable Blocks link (#13653)
Browse files Browse the repository at this point in the history
* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link (forgotten file)

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* fix: Import missing addQueryArgs method

* chore: Update package-lock after run npm@6.7 install
  • Loading branch information
gziolo authored and youknowriad committed Mar 6, 2019
1 parent 088f4cb commit e0b4b3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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' } ) }
>
{ __( 'Manage All Reusable Blocks' ) }
</a>
Expand Down

0 comments on commit e0b4b3b

Please sign in to comment.