• Resolved ygirod

    (@ygirod)


    Hi,

    Size file disappear when rel=”noopener noreferrer” on the PDF link.

    Any idea ?

    Thx $ regards.

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

    (@ygirod)

    Because WP core automatically adds noreferrer, noopener in rel attribute on open links, it clears also the attribute mtli_filesize value. Note: My open links are PDF internal files.

    Meanwhile, awaiting an update of the plugin, I have modified the file mime_type_link_images.php this way.

    On line ~1246 I relplaced

    $replace = str_replace( $match[3], $match[3] . ' rel="mtli_filesize' . str_replace( array( '.', ' ' ), '', $filesize ) . '"', $replace );

    with

    $replace = str_replace( $match[3], $match[3] . ' relmtli="mtli_filesize' . str_replace( array( '.', ' ' ), '', $filesize ) . '"', $replace );

    On line ~1254 I replaced

    $this->filesize_styles[] = 'a[rel~="mtli_filesize' . str_replace( array( '.', ' ' ), '', $filesize ) . '"]:after {content:" ' . $css_filesize_string . '"}';

    with

    $this->filesize_styles[] = 'a[relmtli~="mtli_filesize' . str_replace( array( '.', ' ' ), '', $filesize ) . '"]:after {content:" ' . $css_filesize_string . '"}';

    It seems to work temporarily.

    Thread Starter ygirod

    (@ygirod)

    Any “official” idea or plugin release for this problem ? ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Size file disappear when rel=”noopener noreferrer”’ is closed to new replies.