Closed
Conversation
aduth
reviewed
Feb 9, 2018
|
|
||
| ```php | ||
| function register_post_type() { | ||
| function my_template_to_books() { |
Member
There was a problem hiding this comment.
Good catch on this conflicting with the core register_post_type function name. To better reflect that this is registering a post type, though, maybe it should be named as such, while still avoiding the conflict?
Thinking something along the lines of...
function register_book_post_type() {}function myplugin_register_post_types() {}Thoughts?
Contributor
There was a problem hiding this comment.
myplugin_register_book_post_type would be best.
Since this is PHP code in the global namespace, it's best practice to use a vendor prefix in the function. Using unique function prefixes or namespaces is required by dot org theme and plug-in directories.
Shelob9
added a commit
to Shelob9/gutenberg
that referenced
this pull request
Feb 27, 2018
Contributor
|
Superseded by #5150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.