get_material_by_item_id( $thepostid, 0, 0, 1 ) ?? []; $max_file_size = (int) LP_Settings::get_option( 'material_max_file_size', 2 ); $allow_upload_amount = (int) LP_Settings::get_option( 'material_upload_files', 2 ); // check file was uploaded $uploaded_files = count( $course_materials ); // check file amount which can upload $can_upload = $allow_upload_amount - $uploaded_files; $allow_file_type = LP_Settings::get_option( 'material_allow_file_type', array( 'pdf', 'txt' ) ); $accept = ''; $accept_file_type = implode( ', ', $allow_file_type ); $material_mime_types = LP_Settings::lp_material_file_types(); foreach ( $allow_file_type as $ext ) { $accept .= $material_mime_types[ $ext ] . ','; } $accept = rtrim( $accept, ',' ); ?>