[Beehive Pro] Add Beehive Stats to Custom Post Types

0

Hi,
After finding the nice stats on individual posts provided by Beehive Pro. It would be nice to be able to expand/see those stats on Custom Post types. For example we use The Events Calendar by Modern Tribe and Wp Job Manager, in both cases clients would benefit from seeing the stats for the individual Jobs/Events. The ability to enable the stats for CPT’s (similar to SmartCrawl) would be ideal.

Kind Regards

Mark

  • Dimitris Kalliris
    • Support Team Lead

    Hello Mark

    Here’s an example snippet you can use to enable support for custom post types.
    This will be added to the plugin UI soon!

    <?php
    add_filter( 'beehive_google_analytics_post_types', function ( $post_types ) {
    	// Add your custom post type here.
    	$post_types[] = 'my-custom-post-type';
    
    	return $post_types;
    } );

    You can either add that snippet in the functions.php file of your child-theme (omit the opening <?php part), or as is in a MU plugin file.

    Keep in mind that you should also replace my-custom-post-type with the CPT name of the events coming from this plugin (for example, it should be tribe_events for Events Calendar, unless they’ve changed something recently).

    Warm regards,
    Dimitris