-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
Still requires the additional metafields setup to capture the extra data, but otherwise as a basis for the custom post type definition, this is ready for review. |
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.
For the meta fields, we'll want to use either Gutenberg blocks that use postmeta as their attribute sources.
includes/class-amp-travel-cpt.php
Outdated
'show_ui' => true, | ||
'show_in_nav_menus' => true, | ||
'show_in_menu' => true, | ||
'show_in_admin_bar' => true, |
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.
This is missing show_in_rest
which is required for Gutenberg.
includes/class-amp-travel-cpt.php
Outdated
*/ | ||
add_theme_support( 'post-thumbnails' ); | ||
|
||
// Image Sizes. |
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.
This should be a phpdoc comment to describe the filter.
Thanks @westonruter - I have addressed the changes you requested. Feel free to review when you have time. |
@DavidCramer On the Wondering if that's something that only I'm experiencing or if it's an issue with Gutenberg. If you have a moment could you try if it works OK for you? |
includes/class-amp-travel-cpt.php
Outdated
* | ||
* @package WPAMPTheme | ||
*/ | ||
class AMP_Travel_CTP { |
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.
Looks like a typo, should probably be _CPT
instead of _CTP
.
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.
oops yes, will fix
@miina I haven't tested yet in Gutenberg yet as this was just the definition of the type. But I think I should put it back to WIP and get that aspect sorted. |
@westonruter - I initially did this just as the CPT definition. However, as @miina pointed out, it's not working yet with Gutenberg. I'll do more tests and clean it up first, then will let you know when you can review it again. |
@westonruter @ThierryA this is ready for review now. @miina I have tested with Gutenberg and it behaves as expected. |
Use AMP_Travel_Theme::instantiate_classes(). And change AMP_Travel_CPT::__contstruct to init(). This uses the bootstrap mechanism in the develop branch.
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.
Almost Ready, A Few Points
Hi @DavidCramer,
Thanks for registering the new 'adventure'
post type. There are a few points here, one of which might not need any action.
includes/class-amp-travel-cpt.php
Outdated
'description' => __( 'Adventure Custom Post Type for travel theme.', 'travel' ), | ||
'public' => true, | ||
'exclude_from_search' => true, | ||
'publicly_queryable' => true, |
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.
The following arguments have the default value, and are not needed:
- publicly_queryable
- show_ui
- show_in_nav_menus
- show_in_menu
- show_in_admin_bar
- capability_type
- hierarchical
- query_var
- can_export
- rest_controller_class
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.
@kienstra - yup, I'll remove them.
includes/class-amp-travel-cpt.php
Outdated
'280x158', | ||
'240x135', | ||
'160x90', | ||
'122x67', |
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.
Are all of these image sizes needed?
You know more about the specifics than I do. But it seems excessive to create 15 image sizes for every image uploaded.
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.
@kienstra - no idea. but it's a good point. I took these from the ampconf
theme as a starting point. I'll reduce it down to what I think should be needed for the current blocks, etc.
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.
This is something that we should revisit. But I'm going to merge this PR to unblock other PRs.
These look to have been from PR #33. And they might be valid. But defer the discussion of those to that PR.
We might need custom image sizes, so continue this conversation. But several PRs depend on this PR, so it would help to merge it.
In that class, make all functions public. Change __construct() to init(), and move the requiring of class-amp-travel-cpt.php to AMP_Travel_Theme::includes(). Thanks to David for creating that file. This keeps all of the logic of the plugin files self-sufficient. functions.php wil only have to require class-amp-travel-theme.php. And call amp_travel_theme()->init().
And its instantiation. That class isn't in this branch.
Use the new includes() method to require it. And instantiate and init() it in: instantiate_classes().
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.
Approved
If it's alright, I applied the 2 review points I made with this commit.
@DavidCramer, could you please look at whether there are any more image sizes needed here? I deleted the add_image_size()
call for now, to merge this.
Thanks @kienstra. Can always add additional sizes if needed later. It's all good. |
Adds the
adventure
custom post type.Fixes #7