Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Allow post field control labels to be defined in register_post_type() #195

Merged
merged 4 commits into from Jul 5, 2016

Conversation

lgedeon
Copy link
Contributor

@lgedeon lgedeon commented Jul 4, 2016

Check for field_x in labels when registering post_type and use as lable for default fields

@@ -298,11 +298,12 @@
*/
addTitleControl: function() {
var section = this, control, setting = api( section.id );
var postTypeObj = api.Posts.data.postTypes[ section.params.post_type ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgedeon minor thing, but in the cases where you define a new var postTypeObj in your patch, could you just add postTypeObj to the existing list of variables declared? We're generally having only one single var statement in our code I believe. So you could change this and other instances to:

var section = this, control, setting = api( section.id ), postTypeObj;
postTypeObj = api.Posts.data.postTypes[ section.params.post_type ];

@lgedeon lgedeon changed the title Check for field_x in labels when registering post_type and use as lable Check for field_x in labels when registering post_type and use as label Jul 5, 2016
@westonruter westonruter changed the title Check for field_x in labels when registering post_type and use as label Allow post field control labels to be defined in register_post_type() Jul 5, 2016
@westonruter westonruter merged commit 9932568 into develop Jul 5, 2016
@westonruter westonruter deleted the feature/field-labels branch July 5, 2016 01:13
@westonruter
Copy link
Contributor

@lgedeon Thanks! 🙌

@westonruter westonruter added this to the 0.7 milestone Jul 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants