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

Templates: Check required values #4475

Closed
ghost opened this issue Jan 15, 2018 · 4 comments
Closed

Templates: Check required values #4475

ghost opened this issue Jan 15, 2018 · 4 comments
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Enhancement A suggestion for improvement.
Milestone

Comments

@ghost
Copy link

ghost commented Jan 15, 2018

In the current implementation of templates, it is possible to save the post without filling out any content.

It should be possible to declare values as mandatory, and check this before saving.

@Soean Soean added [Type] Enhancement A suggestion for improvement. [Feature] Templates API Related to API powering block template functionality in the Site Editor labels Jan 15, 2018
@youknowriad
Copy link
Contributor

That's the responsibility of the block IMO. Current CPTs can be created with empty meta and post_content. Gutenberg doesn't change that.

@ghost
Copy link
Author

ghost commented Jan 18, 2018

@youknowriad When building your CPTs with ACF, Pods or alike, this can be done, and thats the behavior the user expects.

That's the responsibility of the block IMO
How can that be done? Is there a javascript callback called before saving or something like that?

@aduth
Copy link
Member

aduth commented Aug 22, 2018

Noting that to me, this is a problem which could be extrapolated to "post is valid" logic generally, to which a template conformance could be a condition.

See also: #7020

@mtias mtias added the Future label Oct 7, 2018
@mtias mtias added this to the Future: Phase 2 milestone Oct 12, 2018
@youknowriad youknowriad modified the milestone: Future Mar 25, 2019
@youknowriad
Copy link
Contributor

With the lock/unlockPostSaving actions this can be performed. The missing aspect is to trigger validation right before saving. This is tracked here #13413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants