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

Plugin: Populate demo content by default content filters #13553

Merged
merged 3 commits into from
Jan 29, 2019

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 28, 2019

This pull request seeks to move handling of the demo content initialization from gutenberg_editor_scripts_and_styles to separate filter handlers in a new file dedicated for demo supports (one of the few PHP extensions Gutenberg will offer atop core from the initial 5.0 release). The reason for this change is to facilitate the removal of gutenberg_editor_scripts_and_styles. Core doesn't otherwise allow for filtering of the $initial_edits it generates for editor initialization, but these can be alternatively provided through the default_content and default_title filters run by get_default_post_to_edit (the function responsible for generating a new post to edit).

Testing instructions:

Verify that the Gutenberg demo content is shown for a new post created via Gutenberg > Demo.

Verify that Gutenberg demo content is not shown for a new post created via Posts > Add New.

Verify that Gutenberg content is not considered even if manually adding a &gutenberg-demo query argument to the URL of any edited post.

Assumed to be called only in the process of generating a new post for edit (the same assumption checked by testing 'auto-draft' status)
@aduth aduth added the Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts label Jan 28, 2019
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.

Works well on my testing 👍

@youknowriad youknowriad added this to the 5.0 (Gutenberg) milestone Jan 29, 2019
@aduth aduth merged commit f84ceca into master Jan 29, 2019
@aduth aduth deleted the update/demo-initial-content-filters branch January 29, 2019 16:36
daniloercoli added a commit that referenced this pull request Jan 30, 2019
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg: (36 commits)
  Fixes plural messages POT generation. (#13577)
  Typo fix (#13595)
  REST API: Remove oEmbed proxy HTML filtering (#13575)
  Removed unnecessary className attribute. Fixes #11664 (#11831)
  Add changelog for RSS block (#13588)
  Components: Set type=button for TabPanel button elements. (#11944)
  Update util.js (#13582)
  Docs: Add accessbility specific page (#13169)
  Rnmobile/media methods refactor (#13554)
  chore(release): publish
  chore(release): publish
  Plugin: Deprecate gutenberg_get_script_polyfill (#13536)
  Block API: Parse entity only when valid character reference (#13512)
  RichText: List: fix indentation (#13563)
  Plugin: Deprecate window._wpLoadGutenbergEditor (#13547)
  Plugin: Avoid setting generic "Edit Post" title on load (#13552)
  Plugin: Populate demo content by default content filters (#13553)
  RichText: List: Fix getParentIndex (#13562)
  RichText: List: Fix outdent with children (#13559)
  Scripts: Remove npm run build from test-e2e default run (#13420)
  ...
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Plugin: Populate demo content by default content filters

* Plugin: Avoid checking post status on default content

Assumed to be called only in the process of generating a new post for edit (the same assumption checked by testing 'auto-draft' status)

* Plugin: Remove unreachable initial_edits code
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Plugin: Populate demo content by default content filters

* Plugin: Avoid checking post status on default content

Assumed to be called only in the process of generating a new post for edit (the same assumption checked by testing 'auto-draft' status)

* Plugin: Remove unreachable initial_edits code
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.

2 participants