WordPress filter hook

jetpack_enable_cpt

Defined by Jetpack and fired by 4 plugins in total, running on 3M+ sites between them.

“This action is documented in classic-theme-helper/src/custom-post-types/class-nova-restaurant.php”

How to use jetpack_enable_cpt

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'jetpack_enable_cpt', function( $value, $arg2 ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

4 plugins that fire jetpack_enable_cpt

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'jetpack_enable_cpt', false, self::CUSTOM_POST_TYPE ) jetpack_vendor/automattic/jetpack-classic-theme-helper/src/custom-post-types/class-jetpack-portfolio.php:314
  2. Essential Content Types icon Essential Content Types20,000+ installs apply_filters( 'jetpack_enable_cpt', false, self::CUSTOM_POST_TYPE ) admin/class-portfolio.php:182
  3. Pixelgrade Assistant icon Pixelgrade Assistant2,000+ installs apply_filters( 'jetpack_enable_cpt', false, self::MENU_ITEM_POST_TYPE ) includes/theme-helpers/jetpack-fallbacks/nova-restaurant/nova.php:130
  4. MAS Elementor icon MAS Elementor800+ installs apply_filters( 'jetpack_enable_cpt', false, self::CUSTOM_POST_TYPE ) portfolio/modules/classes/class-mas-jetpack-portfolio.php:219

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.