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

Create meta boxes only for the taxonomies the post belongs to #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skoldin
Copy link
Contributor

@skoldin skoldin commented Nov 4, 2015

Changes in function meta_boxes()

Add check if the post is in taxonomy to create metaboxes only for the
taxonomies the post belongs to

Remove loop through $wp_post_types. It is not needed anymore. This saves
hundreds of iterations.

Add check if the post is in taxonomy to create metaboxes only for the
taxonomies the post belongs to

Remove loop through $wp_post_types. It is not needed anymore. This saves
hundreds of iterations.
mtekk added a commit that referenced this pull request Nov 5, 2015
@mtekk
Copy link
Owner

mtekk commented Nov 5, 2015

I see the benefit (cleaner interface, sort of). However, there is a problem I see with this, it requires the edit page to be reloaded for the new metaboxes to be available (as a post changes membership in different taxonomies). If you're concerned about looping though too many things, there is a better way to improve this (see the commit 36ebded). Lastly, I would try to avoid relying on the $post global, especially if the action can pass it in for you.

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.

2 participants