php - How can I add custom fields to WordPress's built-in taxonomy meta boxes? -



php - How can I add custom fields to WordPress's built-in taxonomy meta boxes? -

specifically, want add together couple fields categories meta box ('categorydiv'). hoping there filter, couldn't find one. know can create custom meta box, easiest client if see these fields tied choosing category. visual break of new meta box undesirable, , unacceptable have appear anywhere below categories (e.g., under tags).

there no action/filter hook customize output of wp's taxonomy meta boxes. there 2 options: replace categories meta box custom version, or move meta fields categories meta box javascript.

i added custom meta boxes categories div in 5 minutes jquery. prefer version because it's short, simple, , in cases more versatile.

do add_meta_boxes normal, add together function jquery up:

function my_meta_box_customization() { ?> <script> (function($) { $(function(){ $('#my-meta-box-div-id').find('.inside').appendto('#categorydiv') .end().end().remove(); }); })(jquery); </script> <?php } add_action( 'admin_head', 'my_meta_box_customization' );

i throw <style> tag in there, too.

i'm not going bother code replacing categories meta box entirely, general thought be:

remove_meta_box( 'categorydiv', 'post', 'side' ); add_meta_boxes function loads post_categories_meta_box variable , customizes regex or such. mess around adding, removing , re-adding meta boxes desired order (e.g, categories under publish, above tags).

it hassle, , i'm not recommending it.

php wordpress

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -