-
Notifications
You must be signed in to change notification settings - Fork 27
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
v1 custom post type #17
Conversation
Let's rename |
add missing /trunk/ in URL Co-authored-by: Adam Zielinski <[email protected]>
blueprints/custom-post/books.txt
Outdated
'label' => __( 'Book', 'gbt' ), | ||
'description' => __( 'Books', 'gbt' ), | ||
'labels' => $labels, | ||
'supports' => array( 'title', 'editor', excerpt, featured_image), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting PHP Fatal error: Uncaught Error: Undefined constant "excerpt"
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I made changes after I tested it myself. 🤦♀️ I removed supports excerpt
and featured image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work now.
use relative path correctly. Co-authored-by: Adam Zielinski <[email protected]>
@adamziel The reason I used books.txt was that my test directory is in an I tested it all again, and all seems to be fixed now. |
correction of referenced file Co-authored-by: Adam Zielinski <[email protected]>
…into custom-post
remove files not belonging to this branch.
Perfect, thank you! |
…ma (#23) Solves the Blueprint parsing problem as follows: * JSON Schema is the source of truth for the Blueprint data structure * Model classes are generated from JSON Schema * Input Validation is done against the JSON Schema * Mapping validated input into model instances is indirectly done based on the JSON Schema ## Summary of the approach We use [Janephp](https://github.com/janephp/janephp/) to infer the PHP model class structure from the JSON schema We then use Jane's output to generate PHP code using [Nette PHP generator](https://github.com/nette/php-generator): * Model classes * Interfaces for groups of related classes: `StepDefinitionInterface`, `ResourceDefinitionInterface`. * Interface resolution map for the [JsonMapper library](https://jsonmapper.net/). * PHP docstrings with more accurate types than Jane to guide the mapping process From there, the data pipeline looks as follows: 1. Parse raw JSON 2. Validate it with Opis 3. Map it into PHP models using JsonMapper Or, if you're consuming the PHP API directly: 1. Create Model instances 2. Validate them with Opis ## Remaining work - [ ] Solve merge conflicts ## Rationale Parsing and mapping JSON [in TypeScript is a simple problem, but in PHP it's surprisingly involved](WordPress/blueprints#13 (comment)). This PR combines three previously explored approaches into a single pipeline: * WordPress/blueprints#17 * WordPress/blueprints#19 * WordPress/blueprints#21
Blueprint
Enable the user of playground to create posts with certain custom post type, and create single post and archive templates for this post type.
Also props to @ryanwelcher
It's v1