• I notice in your class-frontend.php on lines: <b>111, 114, and 118</b> you forgot to check to see if the title attribute is empty before including it. As such, your code always includes an empty <b>title=”</b> for all image anchors. Can you fix this — to verify that title is empty and if so then do NOT include it?

    Interestingly, you properly did this check in other areas (e.g. line 199) so i can only assume it was an oversight for the other areas?

    Thanks.

    https://wordpress.org/plugins/responsive-lightbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Kimberly

    (@kellogg9)

    Just to clarify, i mean that your code includes a title attribute when none exists. So even if the tag had no title attribute, your code includes one anyway, making it empty: title=””

    Ideally, if no title attribute exists for the anchor tag to begin with then don’t include one (even if you are making it empty).

    It’s not a big deal but html compression plugins are made less efficient because of this (most don’t realize to drop empty title attributes).

    To speed things up the problem areas are on lines: 111, 114, and 118 of class-frontend.php.

    and would need to include something like the following on each of those 3 problem lines:

    ( ! empty ( $title ) ? ‘ title=”‘ . $title . ‘”‘ : ” )

    Thanks!

    Thread Starter Kimberly

    (@kellogg9)

    Just a heads up:

    RL v1.6.3 adds an emtpy title=”” attribute even for <a..> tags that already have title attributes. For example this is what 1.6.3 produces for each image link:

    <a href="http://mydomain.com/" title="my title" title="" data-rel="lightbox-gallery-joK4"><img src="image.jpg"></a>

    Note the extra title=”” which results in a W3C validation error due to two title attributes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Empty title tags being added to all image tags’ is closed to new replies.