HISTORY
https://toolset.com/forums/topic/convert-custom-types-created-by-3rd-party-plugin-without-breaking-plugin-updates/
I am using the LearnDash plugin. LearnDash creates a CPT called sfwd-courses. I am trying to bring sfwd-courses under the control of types in a supported manner that does not break LearnDash plugin updates.
Toolset support LUOY provided me with the following code from the LearnDash plugin:
$this->post_options = apply_filters( 'sfwd_cpt_options', $this->post_options, $this->post_type );
register_post_type( $this->post_type, $this->post_options );
When I asked LearnDash support how to use the code they responded with this:
add_filter("sfwd_cpt_options", function($post_options, $post_type) {
return null;
}, 10, 2);
When add add the above to functions.php and deactivate LearnDash I am able to create the CPT with Types. When I browse to course I receive the following message:
You are not allowed to edit posts in this post type.
QUESTION 1
I am unclear what the intended result of the code below is supposed to be. Is it used to un-register the the CPT? Is it used to add a custom field to sfwd-courses? In either case I imagine I need to replace the variables with actual values. I've tried to do this and failed miserably. Please provide me with a snippet I can copy directly to my child theme's functions.php with information about exactly what the snippet is doing.
add_filter("sfwd_cpt_options", function($post_options, $post_type) {
return null;
}, 10, 2);
QUESTION 2
In my initial request LUOY stated that I shouldn't try to bring LearnDash CPTs under the control of Types because I would no longer be able to update LearnDash (hopefully I am interpreting his response correctly!) Why is this? Types operates on default post types without issue. ACF appears to work on CPTs created by other plugins naturally. I purchased the entire Toolset over 60 days ago and have not been able to integrate it with LearnDash making it totally useless to me and I'm now outside of the refund period.
To make my question more clear "Is there really not a supported method of integrating LearnDash Courses with Types?"