Adding MD Metabox to CPT

Alex

MD developer
Messages
4,883
Reaction score
1,138
Sorry about that, getting close to reimplementing the missing code snippets now that the new documentation page structure is coming together. Here are the filters you can use to add post meta to post types and taxonomies.

PHP:
/**
 * Add MD meta options to any Custom Post Type.
 */

function md_add_post_type_meta( $post_type ) {
    $post_type[] = 'download';
    return $post_type;
}
add_filter( 'md_post_type_meta', 'md_add_post_type_meta' );

/**
 * Add MD meta options to any Custom Taxonomy.
 */

function md_add_taxonomy_meta( $taxonomy ) {
    $taxonomy[] = 'download_category';
    $taxonomy[] = 'product_cat';
    return $taxonomy;
}
add_filter( 'md_taxonomy_meta', 'md_add_taxonomy_meta' );
 

Alex

MD developer
Messages
4,883
Reaction score
1,138
Just for your knowledge I have restored the code snippets to the documentation. See example for this code snippet:

 
Top