WordPress.org

Make WordPress Core

Opened 3 years ago

#39969 new enhancement

add filter to end of post_categories_meta_box()

Reported by: pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:
PR Number:

Description

I have a need to output short "instructional" text below taxonomy metaboxes on the post{,-new}.php screens. This text is to help admin users decide when/if to assign terms to a given (custom) post.

I currently do something similar in the featured image metabox, i.e., I hook into 'admin_post_thumbnail_html' (which is applied at the end of _wp_post_thumbnail_html()) to add text to tell admin users what image dimensions the featured image for a particular (custom) post should have.

Thus, it would be helpful if there were a similar filter applied at the end of post_categories_meta_box().

My current workaround is to add a

'meta_box_cb' => 'custom_tax_meta_box'

to the args when I register the taxonomy, and my custom_tax_meta_box() function just calls post_categories_meta_box() and then adds the text. Of course, this works, but is not very elegant and not very "future proof" (i.e., if WP core changes how taxonomy metaboxes are created them this workaround will break).

Attachments (2)

fi-metabox.png (65.9 KB) - added by pbiron 3 years ago.
this illustrates the kind of text I add to Featured Image metaboxes with the 'admin_post_thumbnail_html' filter
sa-metabox.png (15.9 KB) - added by pbiron 3 years ago.
this illustrates the kind of text I add to hierarchical tax metaboxes with my current workaround

Download all attachments as: .zip

Change History (2)

@pbiron
3 years ago

this illustrates the kind of text I add to Featured Image metaboxes with the 'admin_post_thumbnail_html' filter

@pbiron
3 years ago

this illustrates the kind of text I add to hierarchical tax metaboxes with my current workaround

Note: See TracTickets for help on using tickets.