Skip to content

Instantly share code, notes, and snippets.

@dtbaker
dtbaker / term-meta.php
Last active August 8, 2018 06:31 — forked from chrisdc/term-meta.php
Add a custom meta box to the new/edit category pages. The meta data is saved using update_term_meta.
<?php
/**
*Add meta box to the term category page.
*/
function dtbaker_taxonomy_edit_meta_field( $term ) {
// Retrieve the existing value(s) for this meta field.
$term_meta = $term && !empty($term->term_id) ? get_term_meta( $term->term_id, 'custom_page_id', true ) : false;
?>
<tr class="form-field">