Skip to content

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

Open
skoldin wants to merge 1 commit intomtekk:masterfrom
skoldin:improve/showOnlyBoundTerms
Open

Create meta boxes only for the taxonomies the post belongs to#6
skoldin wants to merge 1 commit intomtekk:masterfrom
skoldin:improve/showOnlyBoundTerms

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

Comments