Featured image alt attribute
-
Hi there,
Hope you’re doing well! I just wanted to bring to your attention a possible issue with the file lifterlms/includes/llms.template.functions.php line 807, in the function llms_featured_img(). Currently, the code uses the title of the course as the alt attribute for the featured image, but I think it would be better to use the alt attribute of the image itself (if it exists). Here’s the relevant code:
return apply_filters( 'lifterlms_featured_img', '<img src="' . $img[0] . '" alt="' . get_the_title( $post_id ) . '" class="llms-featured-image wp-post-image">' );
I’ve been using LifterLMS on a multilingual site and I noticed that when I set a course to a specific language, the language tag in the title caused the code to break. I was able to solve the issue by using the lifterlms_featured_img filter, but I think it would be better if the alt attribute of the featured image was used instead.
Could you please take a look at this and consider making the adjustment in a future version?
Thank you for your time!
- The topic ‘Featured image alt attribute’ is closed to new replies.