Add a filter to allow extending supported post types
-
Hello,
The plugin currently hardcodes the supported post types in
OBJECT_TYPESatcomponents/ads/class-main.php:const OBJECT_TYPES = array( 'page', 'post' );This constant gates:
- The “Raptive Ads” CMB2 metabox registration (line 214)
- The per-post admin-ads override in
admin_ads_disabled()(line 459)
Sites that publish ad-supported content under custom post types (CPTs) currently have no supported way to extend this list. Editing the plugin file directly works but gets wiped on every plugin update.
Request: Could you wrap
OBJECT_TYPESin a filter, e.g.:$object_types = apply_filters( 'adthrive_ads_object_types', self::OBJECT_TYPES );…and use
$object_typesin place ofself::OBJECT_TYPESin the three usages. That would let us register the metabox on our CPTs from a theme or mu-plugin without modifying plugin files.thanks!
You must be logged in to reply to this topic.