Skip to content

Commit

Permalink
post types from tutor object
Browse files Browse the repository at this point in the history
  • Loading branch information
harunollyo committed Dec 22, 2023
1 parent 1936347 commit c65f3f0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions classes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public function add_identifier_class_to_body( $classes ) {
$to_add[] = 'tutor-screen-frontend-dashboard';
}

if ( is_post_type_archive( 'courses' ) ) {
if ( is_post_type_archive( tutor()->course_post_type ) ) {
$to_add[] = 'tutor-frontend';
}

Expand All @@ -594,7 +594,16 @@ public function add_identifier_class_to_body( $classes ) {

if ( is_single() ) {
global $post;
$post_types = array( 'lesson', 'courses', 'tutor_quiz', 'tutor_assignments', 'tutor-google-meet', 'tutor_zoom_meeting' );

$post_types = array(
tutor()->course_post_type,
tutor()->lesson_post_type,
tutor()->quiz_post_type,
tutor()->assignment_post_type,
tutor()->zoom_post_type,
tutor()->meet_post_type,
);

if ( isset( $post->post_type ) && in_array( $post->post_type, $post_types, true ) ) {
$to_add[] = 'tutor-frontend';
}
Expand Down

0 comments on commit c65f3f0

Please # to comment.