-
Notifications
You must be signed in to change notification settings - Fork 0
Adds custom post types and taxonomies #14
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
Conversation
Adds Album, Artist, and Song CPTs. Adds Genre taxonomy.
Shouldn't be extended here.
| return null; | ||
| } | ||
|
|
||
| if (isResolving) { |
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.
Not a blocker, but this and the other return statement can be defined by adding a ternary. Something like this ( you'll need to test it as I just wrote it up offhand)
<PluginDocumentSettingPanel
name="album-parent-artist"
title={__('Artist', 'bifrost-music')}
>
{ isResolving ? ( <Spinner /> ) : (
<SelectControl
__next40pxDefaultSize
__nextHasNoMarginBottom
value={currentParent || 0}
options={options}
onChange={(value) => editPost({ parent: parseInt(value, 10) })}>
)}
</PluginDocumentSettingPanel>
ryanwelcher
left a comment
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 left some comments with some recommendations. None are blockers (maybe the -1 issue) so we can merge BUT we're going to need to figure out the PHPCS standards as per our discussion and that may require some changes to the code here.... ahem... whitespace :)
|
|
||
| return { | ||
| albums: select(coreStore).getEntityRecords('postType', 'music_album', { | ||
| per_page: -1, |
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.
We'll never have enough to use -1 and it's a bad practice to promote. Can we set a high limit like 100?
| return null; | ||
| } | ||
|
|
||
| if (isResolving) { |
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.
Same note as above on the combined return statement.
| @@ -0,0 +1,8 @@ | |||
| const defaultConfig = require('@wordpress/scripts/config/webpack.config'); | |||
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 may not be required. You can just pass the name of the file to build to the script:
"build": "wp-scripts build ./src/editor.js",
"start": "wp-scripts start ./src/editor.js",I can't remember if the output file is still named editor.js, so that might need be updated for the enqueue.
Adds Artist, Song, and Album CPTs along with the Genre taxonomy.