• Resolved Fernando Tellado

    (@fernandot)


    I’ve updated Sensei LMS an Sensei Pro and all the attachments added by this plugin have disappeared from the lessons. My only option is to add them as an Archive block.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Peter Kiss (a11n)

    (@yscik8)

    The Media attachments extension is not supporting Learning mode or block-based themes for now. The recommended alternative is to use the File block, which should provide the same functionality.

    In case you have a lot of existing lessons set up with media attachments, here is a snippet to add the section back for learning mode lessons:

    
    add_filter( 'sensei_media_attachments_prepend_to_the_content', 'sensei_media_attachments_display_attached_media' );
    
    function sensei_media_attachments_display_attached_media( $show ) {
    	$is_learning_mode = class_exists('Sensei_Course_Theme_Option') && Sensei_Course_Theme_Option::should_use_learning_mode();
    	return $show || $is_learning_mode;
    }
    

    Or an alternative for all lessons if using a block theme:

    
    remove_action( 'sensei_single_lesson_content_inside_after', array( Sensei_Media_Attachments::instance(), 'display_attached_media' ), 35 );
    add_filter( 'sensei_media_attachments_prepend_to_the_content', 'sensei_media_attachments_display_attached_media' );
    
    function sensei_media_attachments_display_attached_media( $display ) {
    	return $display || is_singular( 'lesson' ) ;
    }
    

    Note that these will show the attachments before the lesson content.

    Thread Starter Fernando Tellado

    (@fernandot)

    Thank you @yscik8

    I’ve added an Archive block as fallback for the attachments. I’ll try the code provided ??

    Do you know if there are plans to update the Attachments plugin in order to support the Learning Mode?

    Hi @fernandot,

    > Do you know if there are plans to update the Attachments plugin in order to support the Learning Mode?

    We have plans to deprecate this plugin and help those using migrate to using Blocks instead.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attachments have disappeared after update’ is closed to new replies.