ID, true ); if ( ! $courseModel ) { return; } $singleCourseTemplate = SingleCourseTemplate::instance(); echo $singleCourseTemplate->html_image( $courseModel ); } /** * Column author * @use WP_List_Table::single_row_columns * call_user_func( array( $this, 'column_' . $column_name ), $item ) * * @param $post * * @return void */ public function column_author( $post ) { LP_Abstract_Post_Type::column_author( $post ); } /** * Column Curriculum * @use WP_List_Table::single_row_columns * call_user_func( array( $this, 'column_' . $column_name ), $item ) * * @param $post * * @return void */ public function column_curriculum( $post ) { $courseModel = CourseModel::find( $post->ID, true ); if ( ! $courseModel ) { return; } $count_sections = $courseModel->get_total_sections(); $html_count_item = ''; $item_types_of_course = CourseModel::item_types_support(); foreach ( $item_types_of_course as $type ) { $count_items = $courseModel->count_items( $type ); $html_count_item .= sprintf( '
%d %s
', $count_items, LP_Helper::get_i18n_string_plural( $count_items, $type, false ) ); } $section = [ 'count_section' => sprintf( '
%d %s
', $count_sections, _n( 'Section', 'Sections', $count_sections, 'learnpress' ) ), 'count_item' => $html_count_item, ]; echo Template::combine_components( $section ); } /** * Column count student * @use WP_List_Table::single_row_columns * call_user_func( array( $this, 'column_' . $column_name ), $item ) * * @param $post * * @return void */ public function column_student( $post ) { $courseModel = CourseModel::find( $post->ID, true ); if ( ! $courseModel ) { return; } // Count students printf( '
%d
', $courseModel->count_students() ); // Button view list students printf( '%s', $post->ID, esc_attr( $post->post_title ), esc_html__( 'View List', 'learnpress' ) ); } /** * Column count student * @use WP_List_Table::single_row_columns * call_user_func( array( $this, 'column_' . $column_name ), $item ) * * @param $post * * @return void */ public function column_price( $post ) { $courseModel = CourseModel::find( $post->ID, true ); if ( ! $courseModel ) { return; } echo SingleCourseTemplate::instance()->html_price( $courseModel ); } }