Skip to content
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

Context location setup #836

Merged
merged 13 commits into from Jan 16, 2017
Merged

Context location setup #836

merged 13 commits into from Jan 16, 2017

Conversation

norcross
Copy link
Collaborator

Changes proposed in this pull request

extending the use of the context arg to allow for placement in other locations inside the post editor. new areas:

  • form_top : calls the edit_form_top action
  • before_permalink : calls the edit_form_before_permalink action
  • after_title : calls the edit_form_after_title action
  • after_editor : calls the edit_form_after_editor action

Copy link
Member

@jtsternberg jtsternberg left a comment

Choose a reason for hiding this comment

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

As discussed, this looks good. I left a couple comments/questions inline. Let me know if you have any questions.

}

// Include a generic context wrapper and the postbox wrapper.
$classes[] = 'postbox cmb2-context-wrap';
Copy link
Member

Choose a reason for hiding this comment

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

Unless you have a specific reason, I think i'll nix the postbox class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the postbox class ensures it looks like the other metaboxes. I can create a conditional if you'd prefer.

Copy link
Member

Choose a reason for hiding this comment

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

@norcross makes sense. I think I was seeing it cached, so it looked a little wonky. What do you think about outputting the entire metabox markup, allowing "metaboxes" in those other locations? (let's not worry about that for now)

if ( ! $this->show_on() ) {
return;
}

Copy link
Member

Choose a reason for hiding this comment

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

I think we'll probably need to check if the we're looking at the right post-type before we output the form. See the post-type loop in CMB2_hookup::add_metaboxes().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

@jtsternberg jtsternberg merged commit 7d4040f into trunk Jan 16, 2017
@jtsternberg
Copy link
Member

💥 thank you Mr. @norcross!

jtsternberg added a commit that referenced this pull request Jan 16, 2017
jtsternberg added a commit that referenced this pull request Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants