CM Tooltip Guide: Display Metaboxes on Custom Post type

The user guide has moved to a new location

This page is no longer maintained

In version 2.7.5 of CM Tooltip Glossary (Pro+/Ecommerce) we’ve added the possibility to define the Custom Post Types for which we show the metaboxes titled:

  • “CM Tooltip – Disables”
  • “CM Tooltip – Allowed Terms”
metaboxes

How the metaboxes usually appear on the Post/Page edit screen.

Options (basic)

The simplest way to display those metaboxes on non-standard (not ‘post’ or ‘page’) post types is to change the new options in: Settings -> General Settings -> Metaboxes 

When one of the options is checked – the given metabox will appear for every custom post type on the website.

When the option is unchecked (default) – the metaboxes will only appear on built-in WordPress post types (‘post’,’page’).

metaboxes-options

Metabox options of CM Tooltip Glossary Pro+/Ecommerce


Filters (advanced)

For better control over the custom post types which should display those metaboxes we’ve prepared WordPress filters:

“CM Tooltip – Disables”

Filter name: cmtt_disable_metabox_posttypes

Parameter: <array> – list of post types

Return: <array> – filtered list of post types

Usage:

add_filter('cmtt_disable_metabox_posttypes', 'custom_cmtt_metabox_posttype');
function custom_cmtt_metabox_posttype($posttypes) { 
 $posttypes[] = 'customposttype'; 
 return $posttypes;
}

“CM Tooltip – Allowed terms”

Filter name: cmtt_disable_metabox_posttypes

Parameter: <array> – list of post types

Return: <array> – filtered list of post types

Usage:

add_filter('cmtt_allowed_terms_metabox_posttypes', 'custom_cmtt_metabox_posttype');
function custom_cmtt_metabox_posttype($posttypes) {
 $posttypes[] = 'customposttype';  
 return $posttypes;
}

After adding this code in your theme’s functions.php file (and changing the “customposttype” with the id of the custom post type that you want) the chosen metabox will appear on the Edit Page for given Custom Post Type.

 

https://www.cminds.com/wordpress-plugins-knowledge-base-and-documentation/?hscat=6-cm-tooltip