# TutorLMS Lesson custom post type - Discourse linked post not saved \[solved\]

**URL:** https://meta.discourse.org/t/tutorlms-lesson-custom-post-type-discourse-linked-post-not-saved-solved/344157
**Category:** WordPress
**Created:** [December 24, 2024, 6:44am UTC](https://meta.discourse.org/t/tutorlms-lesson-custom-post-type-discourse-linked-post-not-saved-solved/344157 "2024-12-24T06:44:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [December 24, 2024, 6:44am UTC](https://meta.discourse.org/t/tutorlms-lesson-custom-post-type-discourse-linked-post-not-saved-solved/344157/1 "2024-12-24T06:44:24Z")

</div>

Hey guys

I found this thread with similar issue like the one I am experiencing: [Discourse Publishing Link for Custom Post Type Disappears](https://meta.discourse.org/t/discourse-publishing-link-for-custom-post-type-disappears/252473/)

I am using TutorLMS WP plugin which registers its lesson Custom post type

I can connect a Lesson post to an existing topic and post the content to Discourse. But after reloading the wp editor, the topic is not linked anymore.

@angus if necessary, I can give you access to our Staging to reproduce the issue.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [December 24, 2024, 8:05am UTC](https://meta.discourse.org/t/tutorlms-lesson-custom-post-type-discourse-linked-post-not-saved-solved/344157/2 "2024-12-24T08:05:55Z")

</div>

Solved it via

```php

function add_custom_fields_support_to_lesson() {
    add_post_type_support('lesson', 'custom-fields');
}
add_action('init', 'add_custom_fields_support_to_lesson', 11);

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 23, 2025, 8:06am UTC](https://meta.discourse.org/t/tutorlms-lesson-custom-post-type-discourse-linked-post-not-saved-solved/344157/3 "2025-01-23T08:06:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
