gdbbx_image_thumbnail_rel

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Modify the REL used for the thumbnails when displaying a list of attachments.┬áThe filter ‘gdbbx_image_thumbnail_rel‘ allows you to change the REL value.

This filter provides 3 arguments.

Arguments

  • $rel: default REL value, starting from the REL in the plugin settings
  • $obj: attachment post object
  • $ext: extension for the file

Example

If the REL is set in the settings, this example will set it to empty for PDF files only.

add_filter('gdbbx_image_thumbnail_rel', 'custom__gdbbx_image_thumbnail_rel', 10, 3);
function custom__gdbbx_image_thumbnail_rel($rel, $obj, $ext) {
  if ($ext == 'pdf') {
    $rel = '';
  }

  return $rel;
}

 

0
0
745
Rate this reference

You are not allowed to rate this post.

Leave a Comment