diff --git a/includes/tutor-general-functions.php b/includes/tutor-general-functions.php index 6bd20ef199..159f80e61a 100644 --- a/includes/tutor-general-functions.php +++ b/includes/tutor-general-functions.php @@ -1241,6 +1241,16 @@ function tutor_getallheaders() { } } + if ( ! isset( $headers['Authorization'] ) ) { + foreach ( $headers as $name => $value ) { + if ( strtolower( $name ) === 'authorization' ) { + unset( $headers[$name] ); + $headers['Authorization'] = $value; + break; + } + } + } + return $headers; } } diff --git a/includes/tutor-template-functions.php b/includes/tutor-template-functions.php index a15ccf4f76..251cc9ce91 100644 --- a/includes/tutor-template-functions.php +++ b/includes/tutor-template-functions.php @@ -545,14 +545,23 @@ function get_tutor_course_thumbnail( $size = 'post-thumbnail', $url = false ) { $placeholder_url = tutor()->url . 'assets/images/placeholder.svg'; $thumb_url = $post_thumbnail_id ? wp_get_attachment_image_url( $post_thumbnail_id, $size ) : $placeholder_url; $thumb_url = apply_filters( 'tutor_course_thumb_url', $thumb_url, $post_id, $size, $post_thumbnail_id ); + $alt_text = ''; if ( $url ) { return $thumb_url; } + if ( $post_thumbnail_id ) { + $alt_text = get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true ); + } + + if ( empty( $alt_text ) ) { + $alt_text = get_the_title( $post_id ); + } + echo '
- -
'; + ' . esc_attr( $alt_text ) . ' + '; } } diff --git a/restapi/RestAuth.php b/restapi/RestAuth.php index c6030c723b..a8b7de3bd0 100644 --- a/restapi/RestAuth.php +++ b/restapi/RestAuth.php @@ -303,7 +303,7 @@ public static function validate_api_key_secret( $api_key, $api_secret, $return_r * @return boolean */ public static function process_api_request() { - $headers = apache_request_headers(); + $headers = tutor_getallheaders(); if ( isset( $headers['Authorization'] ) ) { $authorization_header = $headers['Authorization'];