Closed agrolsy closed 4 years ago
I was able to accomplish this by modifying line 413 of class.pmproseries.php:
$pmpros_post_types = apply_filters("pmpros_post_types", array("post", "page", "your_cpt_here"));
but of course this is not update-proof. Not sure how to make it more dynamic.
Thanks a million for your super fast response and solution!! That worked very well! I'll just watch out for future updates and hope that a setting for which post types to include can be shown in the future.
Since it looks like the $pmpros_post_types
value is wrapped in a filter hook (the pmpros_post_types
filter), is there a way to update this variable via a child theme's functions.php
file?
I'm not certain how one would write the filter function though... I tried referencing the WP docs about it here, but I don't feel confident enough to mess around with writing my own filter, and I'm still not even sure the plugin has been written to allow us to filter that post type array in the $pmpros_post_types
variable.
Any suggestions from the developers?
I also need a solution for this.
To anyone who might come across this thread: you can add PMPro Series support for your custom post types by putting the following code in your functions.php file:
function add_cpt_to_pmpro_series($postTypes) {
// Repeat the following line for other post types as necessary
$postTypes[] = 'yourPostTypeHere';
return $postTypes;
}
add_filter('pmpros_post_types', 'add_cpt_to_pmpro_series');
Just replace yourPostTypeHere
with the name of your custom post type. This will keep any existing post types available, but also tack on the one you specify.
Closing as this question has been answered by @positivejam.
Is it possible to add support for custom post types? Instead of just being able to select posts and pages f ex being able to select a WP Courseware course unit? (without having to create a post/page that shows just that unit)