Skip to content

Post meta not saved if attributes not included in block JS #7425

Closed

Description

Not sure if this is a bug or if this expected behaviour but I think the post_meta should save if the attributes have been registered in PHP (and not in JS).

To Reproduce
Steps to reproduce the behavior:

  1. Register a dynamic block with php containing at least one meta attribute (making sure post type supports rest and meta has been registered)
  2. Create the required JS with no attributes
  3. Create new post enter
  4. Save post

Expected behavior
Post meta is saved/updated

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • windows 10
  • chrome
  • 67

Additional context

  • Gutenberg version 3.0.1.

If I include the following in my block JS the meta value gets saved but if this is only included in PHP it does not:
attributes: { myMeta: { type: 'string', source: 'meta', meta: 'my_meta' } },

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

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Feature] Block APIAPI that allows to express the block paradigm.[Type] QuestionQuestions about the design or development of the editor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions