• Resolved melissacrokis

    (@melissacrokis)


    Hi!

    I need change default value for duration of the lesson. I need set it as disabled (0) by default. Is it possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ken Nguyen

    (@kendy73)

    function new_learnpress_lesson_meta() {
    	return array(
    		'id'     => 'lesson_settings',
    		'title'  => __( 'Lesson Settings', 'learnpress' ),
    		'pages'  => array( LP_LESSON_CPT ),
    		'fields' => array(
    			array(
    				'name'         => __( 'Lesson Duration', 'learnpress' ),
    				'id'           => '_lp_duration',
    				'type'         => 'duration',
    				'default_time' => 'minute',
    				'desc'         => __( 'Duration of the lesson. Set 0 to disable.', 'learnpress' ),
    				'std'          => 0,
    			),
    			array(
    				'name' => __( 'Preview Lesson', 'learnpress' ),
    				'id'   => '_lp_preview',
    				'type' => 'yes-no',
    				'desc' => __( 'If this is a preview lesson, then student can view this lesson content without taking the course.', 'learnpress' ),
    				'std'  => 'no'
    			)
    		)
    	);
    }
    
    add_filter( 'learn_press_lesson_meta_box_args', 'new_learnpress_lesson_meta', 10 );

    Please try to use this filter in your child theme ??

    Let me know.

    Thread Starter melissacrokis

    (@melissacrokis)

    The filter works correctly. Thank you!

    Plugin Contributor Ken Nguyen

    (@kendy73)

    Hope you like LearnPress and consider rating it a 5 stars ??

    Thread Starter melissacrokis

    (@melissacrokis)

    Hello:

    I’m using this filter, and it works correctly when I create a lesson by “LearnPress > Lessons” option in admin menu.

    However, if I create a lesson directly while I’m editing a course, the filter is not being applied.

    Is it possible set duration of the lesson as disabled (0) by default in this case?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set lesson duration as disabled (0) by default’ is closed to new replies.