How to add Thesis Post Meta to any Custom Post Type in WordPress

As of version 2.10, Thesis only adds its core post meta options* to Pages and Posts. This prevents undesirable clutter in the WordPress Editor when working with other custom post types (where the core Thesis post meta options are often irrelevant).

*Title Tag, Meta Description, Meta Keywords, Meta Robots, Markup Schema, Canonical URL, Custom Body Class, Custom “Read More” Text, 301 Redirect, Custom Template Selector

However, some custom post types could be enhanced by the core Thesis post meta—specifically, any custom post type that has an endpoint URL.

In these cases, you’ll need to add the core Thesis post meta to your CPT with custom PHP. Here’s the code you need to make it happen:

add_action('init', 'add_thesis_post_meta', 100);

function add_thesis_post_meta() {
	global $thesis;
	if (!empty($thesis->box_post_meta))
		foreach ($thesis->box_post_meta as $meta)
			add_filter("{$meta}_post_meta_cpt", 'custom_filter_post_meta');
}

function custom_filter_post_meta($meta) {
	$meta[] = 'your-cpt-reference-name';
	return $meta;
}

In the code above, simply replace your-cpt-reference-name with the proper value from your custom post type, and Thesis will add its core post meta options to your CPT!