Please or Register to create posts and topics.

Auto-Create New Forum Topics from New Courses in LearnDash

Hello,

I am using LearnDash and I noticed that new topics cannot be autogenerated (or at least assigned to a forum from the wordpress post editor) as LearnDash have their own custom post types. Is this correct?

On the left hand bar, under “create forum topic” with the dropdown to choose a forum it is not showing in the course post page (as it shows in WordPress regular pages and posts area of the dashboard).

Is there a way to enable this and make this option available? Where would be the best place to start inspecting how to add LearnDash post types?

Thanks in advance!

Hey @nim,

it’s not possible at the moment to add the meta box to a custom post type.

I added a filter to add this functionality to the forum in this pull request:

https://github.com/Asgaros/asgaros-forum/pull/293

This filter will be available with the next update, if @asgaros will approve this changes.

To use this filter you can easily use the following code and change “custom_post-type” to the post type that LearnDash is using.

add_filter('asgarosforum_filter_meta_post_type', 'add_post_type');

  // Add custom post type to the list of post types
  function add_post_type ($post_types){
      $post_types[] = 'custom_post_type';

      return $post_types;
  }

 

If you ever wonder how to return the favour for helping you.

Hi @qualmy91

Appreciate your response! I tried to integrate the code you supplied but it didn’t work to show the metabox. LearnDash uses sfwd-courses, sfwd-lessons, etc. for its CPT. Any ideas why?

I also greatly appreciate the issuing of the pull request. I hope Asgaros can implement those changes, as I am sure I’m not alone in this type of requirement? 🙂

Hey @nim,

the code will only work when the pull request will be approved.

For your 2 CPT you can use it like this:

add_filter('asgarosforum_filter_meta_post_type', 'add_post_type');

// Add custom post type to the list of post types
function add_post_type ($post_types){

  $post_types[] = 'fwd-courses';
  $post_types[] = 'sfwd-lessons';

  return $post_types;
}

 

If you ever wonder how to return the favour for helping you.

Hi @qualmy91

Ahh, I see! Sorry, I obviously hadnt read your message properly.. 🙂

Thank you again and hope to the pull request will be approved soon. Have a great weekend!

Hello @nim @qualmy91

I just approved the PR and the filter will be available very soon via the updater!

Nim has reacted to this post.
Nim
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hi @asgaros,

That’s brilliant! Thank you!

Do you have any estimated release date for the update? If not, no worries..we’ll hang tight! 🙂

 

Hey @nim,

the new filter is now available:

Changelog

1.15.8

  • Added: asgarosforum_filter_meta_post_type filter
  • Fixed: Broken TinyMCE-editor in the administration-area
  • Performance improvements and code optimizations
Nim has reacted to this post.
Nim
If you ever wonder how to return the favour for helping you.

Hi @qualmy91,

I saw that! Thank you soooo much for your help. Asgaros is an amazing Forum plugin (planning to leave a review next) and the community is just as amazing! I will pay it forward whenever I can 🙂

Have a great day!

Asgaros and qualmy91 have reacted to this post.
Asgarosqualmy91