LLMS_Metabox_Course_Builder::output()

Override the output method to output a button


Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.course.builder.php

	public function output() {

		$post_id = $this->post->ID;

		$lesson  = false;
		$section = false;
		if ( 'lesson' === $this->post->post_type ) {
			$course = llms_get_post_parent_course( $post_id );
			if ( ! $course ) {
				_e( 'This lesson is not attached to a course.', 'lifterlms' );
				return;
			}
			$course_id = $course->get( 'id' );
			$lesson    = llms_get_post( $this->post );
			$section   = $lesson->get_parent_section() ? llms_get_post( $lesson->get_parent_section() ) : false;
		} else {
			$course = llms_get_post( $post_id );
		}
		?>
		<div class="llms-builder-launcher llms-mb-container">

			<?php if ( $lesson && $section ) : ?>

				<p><strong><?php printf( __( 'Course: %s', 'lifterlms' ), $this->get_title_html( $course->get( 'title' ), get_edit_post_link( $course->get( 'id' ) ) ) ); ?></strong></p>

				<?php $this->output_section( $section, 'previous' ); ?>

				<?php $this->output_section( $section, 'current' ); ?>

				<?php $this->output_section( $section, 'next' ); ?>

			<?php endif; ?>

			<a class="llms-button-primary full" href="<?php echo esc_url( $this->get_builder_url( $course->get( 'id' ) ) ); ?>"><?php _e( 'Launch Course Builder', 'lifterlms' ); ?></a>

		</div>
		<?php

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.30.1 Add llms-mb-container CSS class to container element.
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.