LLMS_Metabox_Course_Builder::output()
Override the output method to output a button
Return Return
(void)
Source Source
File: includes/admin/post-types/meta-boxes/class.llms.meta.box.course.builder.php
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | 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 } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.30.1 | Add llms-mb-container CSS class to container element. |
3.13.0 | Introduced. |