Skip to content

Create separate New Post / Demo submenus#1065

Merged
aduth merged 1 commit intomasterfrom
update/1000-new-post
Jun 8, 2017
Merged

Create separate New Post / Demo submenus#1065
aduth merged 1 commit intomasterfrom
update/1000-new-post

Conversation

@aduth
Copy link
Member

@aduth aduth commented Jun 7, 2017

Closes #1000

This pull request seeks to enable creating new posts, separating Demo to a submenu item of the top-level Gutenberg menu item.

Menu

Testing instructions:

Verify that...

  1. Clicking Gutenberg top-level menu takes you to a blank editor
  2. Clicking on the New Post submenu again takes you to a blank editor
  3. Clicking on the Demo submenu takes you to the editor prepopulated with demo content

@aduth aduth added the Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts label Jun 7, 2017
*
* @param {String} id Unique identifier for editor instance
* @param {Object} post API entity for post to edit
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the documentation match the one changed above?

Bootstrapped post object

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, I totally overlooked this comment. Yes, it probably should.

*/
function gutenberg_scripts_and_styles( $hook ) {
if ( 'toplevel_page_gutenberg' !== $hook ) {
if ( ! preg_match( '/(toplevel|gutenberg)_page_gutenberg(-demo)?/', $hook, $page_match ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure but somehow my browser tried loading all of the Gutenberg scripts when not on Gutenberg, when logging into WP-Admin. I haven't been able to reproduce yet, so I will check this out again in a bit.

Update: Can't reproduce, should be fine.

@BE-Webdesign
Copy link
Contributor

Verify that...

Clicking Gutenberg top-level menu takes you to a blank editor
Clicking on the New Post submenu again takes you to a blank editor
Clicking on the Demo submenu takes you to the editor prepopulated with demo content

Check, check, and check. 👍

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go 👍

Longer term, maybe we should drop the "Gutenberg Menu" and move these links under "Posts":

Posts
-> All (highlighted when editing on guteberg too)
-> Add New
-> Add New Gutenberg Post
-> Add New Gutenberg Demo Post

(Same for other Post Types)

@aduth aduth merged commit 3f727da into master Jun 8, 2017
@aduth aduth deleted the update/1000-new-post branch June 8, 2017 12:56
@aduth
Copy link
Member Author

aduth commented Jun 8, 2017

Thanks both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants