{"id":1871,"date":"2016-07-10T06:42:33","date_gmt":"2016-07-10T06:42:33","guid":{"rendered":"http:\/\/themes.wpbeaches.com\/venobox\/?p=1871"},"modified":"2016-07-10T06:42:33","modified_gmt":"2016-07-10T06:42:33","slug":"add-data-attribute-wordpress-gallery-via-php","status":"publish","type":"post","link":"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/","title":{"rendered":"Add a Data Attribute to a WordPress Gallery via PHP"},"content":{"rendered":"<p>To\u00a0manipulate the linked images, specifically the links themselves in the WordPress <strong>Gallery<\/strong> output for doing things like adding in a CSS class or a data attribute value you can use\u00a0the\u00a0<a href=\"https:\/\/codex.wordpress.org\/Plugin_API\/Filter_Reference\/post_gallery\"><em>post_gallery<\/em><\/a> filter in\u00a0<em>\/wp-includes\/media.php <\/em>which<em>\u00a0<\/em>is the right tool for the job.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12686\" src=\"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png\" alt=\"wordpress-gallery-output-link\" width=\"622\" height=\"80\" \/><\/p>\n<p>The filter can be applied like so&#8230;<\/p>\n\n<div id=\"gist37642054\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        <div class=\"js-gist-file-update-container js-task-list-container\">\n  <div id=\"file-wordpress-gallery-output-php\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-php  \">\n\n        \n<div class=\"js-check-bidi js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file\" data-tab-size=\"8\" data-paste-markdown-skip data-tagsearch-lang=\"PHP\" data-tagsearch-path=\"wordpress-gallery-output.php\">\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L1\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC1\" class=\"blob-code blob-code-inner js-file-line\">&lt;?php<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L2\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC2\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L3\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC3\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L4\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC4\" class=\"blob-code blob-code-inner js-file-line\">add_filter( 'post_gallery', 'themeprefix_gallery_output', 10, 3);<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L5\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC5\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L6\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC6\" class=\"blob-code blob-code-inner js-file-line\">function themeprefix_gallery_output($output, $attr, $instance ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L7\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC7\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L8\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC8\" class=\"blob-code blob-code-inner js-file-line\">global $post, $wp_locale;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L9\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC9\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L10\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC10\" class=\"blob-code blob-code-inner js-file-line\">$html5 = current_theme_supports( 'html5', 'gallery' );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L11\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC11\" class=\"blob-code blob-code-inner js-file-line\">$atts = shortcode_atts( array(<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L12\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC12\" class=\"blob-code blob-code-inner js-file-line\">\t'order'      =&gt; 'ASC',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L13\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC13\" class=\"blob-code blob-code-inner js-file-line\">\t'orderby'    =&gt; 'menu_order ID',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L14\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC14\" class=\"blob-code blob-code-inner js-file-line\">\t'id'         =&gt; $post ? $post-&gt;ID : 0,<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L15\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC15\" class=\"blob-code blob-code-inner js-file-line\">\t'itemtag'    =&gt; $html5 ? 'figure'     : 'dl',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L16\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC16\" class=\"blob-code blob-code-inner js-file-line\">\t'icontag'    =&gt; $html5 ? 'div'        : 'dt',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L17\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC17\" class=\"blob-code blob-code-inner js-file-line\">\t'captiontag' =&gt; $html5 ? 'figcaption' : 'dd',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L18\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC18\" class=\"blob-code blob-code-inner js-file-line\">\t'columns'    =&gt; 3,<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L19\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC19\" class=\"blob-code blob-code-inner js-file-line\">\t'size'       =&gt; 'thumbnail',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L20\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC20\" class=\"blob-code blob-code-inner js-file-line\">\t'include'    =&gt; '',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L21\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC21\" class=\"blob-code blob-code-inner js-file-line\">\t'exclude'    =&gt; '',<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L22\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC22\" class=\"blob-code blob-code-inner js-file-line\">\t'link'       =&gt; ''<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L23\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC23\" class=\"blob-code blob-code-inner js-file-line\">), $attr, 'gallery' );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L24\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC24\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L25\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC25\" class=\"blob-code blob-code-inner js-file-line\">$id = intval( $atts['id'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L26\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC26\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L27\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC27\" class=\"blob-code blob-code-inner js-file-line\">if ( ! empty( $atts['include'] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L28\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC28\" class=\"blob-code blob-code-inner js-file-line\">\t$_attachments = get_posts( array( 'include' =&gt; $atts['include'], 'post_status' =&gt; 'inherit', 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'order' =&gt; $atts['order'], 'orderby' =&gt; $atts['orderby'] ) );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L29\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC29\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L30\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC30\" class=\"blob-code blob-code-inner js-file-line\">\t$attachments = array();<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L31\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC31\" class=\"blob-code blob-code-inner js-file-line\">\tforeach ( $_attachments as $key =&gt; $val ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L32\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC32\" class=\"blob-code blob-code-inner js-file-line\">\t\t$attachments[$val-&gt;ID] = $_attachments[$key];<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L33\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC33\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L34\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC34\" class=\"blob-code blob-code-inner js-file-line\">} elseif ( ! empty( $atts['exclude'] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L35\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC35\" class=\"blob-code blob-code-inner js-file-line\">\t$attachments = get_children( array( 'post_parent' =&gt; $id, 'exclude' =&gt; $atts['exclude'], 'post_status' =&gt; 'inherit', 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'order' =&gt; $atts['order'], 'orderby' =&gt; $atts['orderby'] ) );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L36\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC36\" class=\"blob-code blob-code-inner js-file-line\">} else {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L37\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC37\" class=\"blob-code blob-code-inner js-file-line\">\t$attachments = get_children( array( 'post_parent' =&gt; $id, 'post_status' =&gt; 'inherit', 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'order' =&gt; $atts['order'], 'orderby' =&gt; $atts['orderby'] ) );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L38\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC38\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L39\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"39\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC39\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L40\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"40\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC40\" class=\"blob-code blob-code-inner js-file-line\">if ( empty( $attachments ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L41\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"41\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC41\" class=\"blob-code blob-code-inner js-file-line\">\treturn '';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L42\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"42\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC42\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L43\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"43\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC43\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L44\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"44\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC44\" class=\"blob-code blob-code-inner js-file-line\">if ( is_feed() ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L45\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"45\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC45\" class=\"blob-code blob-code-inner js-file-line\">\t$output = \"\\n\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L46\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"46\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC46\" class=\"blob-code blob-code-inner js-file-line\">\tforeach ( $attachments as $att_id =&gt; $attachment ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L47\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"47\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC47\" class=\"blob-code blob-code-inner js-file-line\">\t\t$output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . \"\\n\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L48\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"48\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC48\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L49\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"49\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC49\" class=\"blob-code blob-code-inner js-file-line\">\treturn $output;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L50\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"50\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC50\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L51\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"51\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC51\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L52\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"52\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC52\" class=\"blob-code blob-code-inner js-file-line\">$itemtag = tag_escape( $atts['itemtag'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L53\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"53\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC53\" class=\"blob-code blob-code-inner js-file-line\">$captiontag = tag_escape( $atts['captiontag'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L54\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"54\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC54\" class=\"blob-code blob-code-inner js-file-line\">$icontag = tag_escape( $atts['icontag'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L55\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"55\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC55\" class=\"blob-code blob-code-inner js-file-line\">$valid_tags = wp_kses_allowed_html( 'post' );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L56\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"56\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC56\" class=\"blob-code blob-code-inner js-file-line\">if ( ! isset( $valid_tags[ $itemtag ] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L57\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"57\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC57\" class=\"blob-code blob-code-inner js-file-line\">\t$itemtag = 'dl';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L58\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"58\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC58\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L59\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"59\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC59\" class=\"blob-code blob-code-inner js-file-line\">if ( ! isset( $valid_tags[ $captiontag ] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L60\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"60\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC60\" class=\"blob-code blob-code-inner js-file-line\">\t$captiontag = 'dd';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L61\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"61\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC61\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L62\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"62\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC62\" class=\"blob-code blob-code-inner js-file-line\">if ( ! isset( $valid_tags[ $icontag ] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L63\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"63\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC63\" class=\"blob-code blob-code-inner js-file-line\">\t$icontag = 'dt';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L64\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"64\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC64\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L65\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"65\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC65\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L66\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"66\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC66\" class=\"blob-code blob-code-inner js-file-line\">$columns = intval( $atts['columns'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L67\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"67\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC67\" class=\"blob-code blob-code-inner js-file-line\">$itemwidth = $columns &gt; 0 ? floor(100\/$columns) : 100;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L68\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"68\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC68\" class=\"blob-code blob-code-inner js-file-line\">$float = is_rtl() ? 'right' : 'left';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L69\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"69\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC69\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L70\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"70\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC70\" class=\"blob-code blob-code-inner js-file-line\">$selector = \"gallery-{$instance}\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L71\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"71\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC71\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L72\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"72\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC72\" class=\"blob-code blob-code-inner js-file-line\">$gallery_style = '';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L73\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"73\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC73\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L74\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"74\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC74\" class=\"blob-code blob-code-inner js-file-line\">\/**<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L75\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"75\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC75\" class=\"blob-code blob-code-inner js-file-line\"> * Filter whether to print default gallery styles.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L76\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"76\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC76\" class=\"blob-code blob-code-inner js-file-line\"> *<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L77\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"77\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC77\" class=\"blob-code blob-code-inner js-file-line\"> * @since 3.1.0<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L78\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"78\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC78\" class=\"blob-code blob-code-inner js-file-line\"> *<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L79\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"79\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC79\" class=\"blob-code blob-code-inner js-file-line\"> * @param bool $print Whether to print default gallery styles.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L80\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"80\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC80\" class=\"blob-code blob-code-inner js-file-line\"> *                    Defaults to false if the theme supports HTML5 galleries.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L81\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"81\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC81\" class=\"blob-code blob-code-inner js-file-line\"> *                    Otherwise, defaults to true.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L82\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"82\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC82\" class=\"blob-code blob-code-inner js-file-line\"> *\/<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L83\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"83\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC83\" class=\"blob-code blob-code-inner js-file-line\">if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L84\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"84\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC84\" class=\"blob-code blob-code-inner js-file-line\">\t$gallery_style = \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L85\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"85\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC85\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;style type='text\/css'&gt;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L86\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"86\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC86\" class=\"blob-code blob-code-inner js-file-line\">\t\t#{$selector} {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L87\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"87\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC87\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tmargin: auto;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L88\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"88\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC88\" class=\"blob-code blob-code-inner js-file-line\">\t\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L89\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"89\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC89\" class=\"blob-code blob-code-inner js-file-line\">\t\t#{$selector} .gallery-item {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L90\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"90\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC90\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfloat: {$float};<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L91\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"91\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC91\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tmargin-top: 10px;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L92\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"92\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC92\" class=\"blob-code blob-code-inner js-file-line\">\t\t\ttext-align: center;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L93\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"93\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC93\" class=\"blob-code blob-code-inner js-file-line\">\t\t\twidth: {$itemwidth}%;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L94\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"94\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC94\" class=\"blob-code blob-code-inner js-file-line\">\t\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L95\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"95\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC95\" class=\"blob-code blob-code-inner js-file-line\">\t\t#{$selector} img {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L96\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"96\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC96\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tborder: 2px solid #cfcfcf;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L97\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"97\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC97\" class=\"blob-code blob-code-inner js-file-line\">\t\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L98\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"98\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC98\" class=\"blob-code blob-code-inner js-file-line\">\t\t#{$selector} .gallery-caption {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L99\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"99\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC99\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tmargin-left: 0;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L100\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"100\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC100\" class=\"blob-code blob-code-inner js-file-line\">\t\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L101\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"101\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC101\" class=\"blob-code blob-code-inner js-file-line\">\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L102\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"102\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC102\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;\/style&gt;\\n\\t\\t\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L103\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"103\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC103\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L104\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"104\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC104\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L105\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"105\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC105\" class=\"blob-code blob-code-inner js-file-line\">$size_class = sanitize_html_class( $atts['size'] );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L106\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"106\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC106\" class=\"blob-code blob-code-inner js-file-line\">$gallery_div = \"&lt;div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L107\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"107\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC107\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L108\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"108\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC108\" class=\"blob-code blob-code-inner js-file-line\">\/**<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L109\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"109\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC109\" class=\"blob-code blob-code-inner js-file-line\"> * Filter the default gallery shortcode CSS styles.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L110\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"110\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC110\" class=\"blob-code blob-code-inner js-file-line\"> *<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L111\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"111\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC111\" class=\"blob-code blob-code-inner js-file-line\"> * @since 2.5.0<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L112\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"112\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC112\" class=\"blob-code blob-code-inner js-file-line\"> *<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L113\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"113\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC113\" class=\"blob-code blob-code-inner js-file-line\"> * @param string $gallery_style Default CSS styles and opening HTML div container<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L114\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"114\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC114\" class=\"blob-code blob-code-inner js-file-line\"> *                              for the gallery shortcode output.<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L115\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"115\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC115\" class=\"blob-code blob-code-inner js-file-line\"> *\/<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L116\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"116\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC116\" class=\"blob-code blob-code-inner js-file-line\">$output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L117\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"117\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC117\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L118\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"118\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC118\" class=\"blob-code blob-code-inner js-file-line\">$i = 0;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L119\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"119\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC119\" class=\"blob-code blob-code-inner js-file-line\">foreach ( $attachments as $id =&gt; $attachment ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L120\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"120\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC120\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L121\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"121\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC121\" class=\"blob-code blob-code-inner js-file-line\">\t$attr = ( trim( $attachment-&gt;post_excerpt ) ) ? array( 'aria-describedby' =&gt; \"$selector-$id\" ) : '';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L122\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"122\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC122\" class=\"blob-code blob-code-inner js-file-line\">\tif ( ! empty( $atts['link'] ) &amp;&amp; 'file' === $atts['link'] ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L123\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"123\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC123\" class=\"blob-code blob-code-inner js-file-line\">\t\t$image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L124\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"124\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC124\" class=\"blob-code blob-code-inner js-file-line\">\t} elseif ( ! empty( $atts['link'] ) &amp;&amp; 'none' === $atts['link'] ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L125\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"125\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC125\" class=\"blob-code blob-code-inner js-file-line\">\t\t$image_output = wp_get_attachment_image( $id, $atts['size'], false, $attr );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L126\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"126\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC126\" class=\"blob-code blob-code-inner js-file-line\">\t} else {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L127\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"127\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC127\" class=\"blob-code blob-code-inner js-file-line\">\t\t$image_output = wp_get_attachment_link( $id, $atts['size'], true, false, false, $attr );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L128\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"128\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC128\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L129\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"129\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC129\" class=\"blob-code blob-code-inner js-file-line\">\t$image_meta  = wp_get_attachment_metadata( $id );<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L130\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"130\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC130\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L131\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"131\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC131\" class=\"blob-code blob-code-inner js-file-line\">\t$orientation = '';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L132\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"132\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC132\" class=\"blob-code blob-code-inner js-file-line\">\tif ( isset( $image_meta['height'], $image_meta['width'] ) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L133\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"133\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC133\" class=\"blob-code blob-code-inner js-file-line\">\t\t$orientation = ( $image_meta['height'] &gt; $image_meta['width'] ) ? 'portrait' : 'landscape';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L134\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"134\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC134\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L135\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"135\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC135\" class=\"blob-code blob-code-inner js-file-line\">\t$output .= \"&lt;{$itemtag} class='gallery-item'&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L136\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"136\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC136\" class=\"blob-code blob-code-inner js-file-line\">\t$output .= \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L137\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"137\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC137\" class=\"blob-code blob-code-inner js-file-line\">\t\t&lt;{$icontag} class='gallery-icon {$orientation}'&gt;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L138\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"138\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC138\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t$image_output<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L139\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"139\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC139\" class=\"blob-code blob-code-inner js-file-line\">\t\t&lt;\/{$icontag}&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L140\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"140\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC140\" class=\"blob-code blob-code-inner js-file-line\">\tif ( $captiontag &amp;&amp; trim($attachment-&gt;post_excerpt) ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L141\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"141\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC141\" class=\"blob-code blob-code-inner js-file-line\">\t\t$output .= \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L142\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"142\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC142\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;{$captiontag} class='wp-caption-text gallery-caption' id='$selector-$id'&gt;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L143\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"143\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC143\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\" . wptexturize($attachment-&gt;post_excerpt) . \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L144\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"144\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC144\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;\/{$captiontag}&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L145\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"145\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC145\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L146\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"146\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC146\" class=\"blob-code blob-code-inner js-file-line\">\t$output .= \"&lt;\/{$itemtag}&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L147\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"147\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC147\" class=\"blob-code blob-code-inner js-file-line\">\tif ( ! $html5 &amp;&amp; $columns &gt; 0 &amp;&amp; ++$i % $columns == 0 ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L148\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"148\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC148\" class=\"blob-code blob-code-inner js-file-line\">\t\t$output .= '&lt;br style=\"clear: both\" \/&gt;';<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L149\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"149\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC149\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L150\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"150\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC150\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L151\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"151\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC151\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L152\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"152\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC152\" class=\"blob-code blob-code-inner js-file-line\">if ( ! $html5 &amp;&amp; $columns &gt; 0 &amp;&amp; $i % $columns !== 0 ) {<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L153\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"153\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC153\" class=\"blob-code blob-code-inner js-file-line\">\t$output .= \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L154\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"154\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC154\" class=\"blob-code blob-code-inner js-file-line\">\t\t&lt;br style='clear: both' \/&gt;\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L155\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"155\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC155\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L156\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"156\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC156\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L157\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"157\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC157\" class=\"blob-code blob-code-inner js-file-line\">$output .= \"<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L158\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"158\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC158\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;\/div&gt;\\n\";<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L159\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"159\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC159\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L160\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"160\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC160\" class=\"blob-code blob-code-inner js-file-line\">return $output;<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L161\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"161\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC161\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr class=\"line\">\n          <td id=\"file-wordpress-gallery-output-php-L162\" class=\"blob-num js-line-number js-code-nav-line-number js-blob-rnum\" data-line-number=\"162\"><\/td>\n          <td id=\"file-wordpress-gallery-output-php-LC162\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c\/raw\/854dc53c3e0748a69f7b6e56ea3e9194e8792421\/wordpress-gallery-output.php\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c#file-wordpress-gallery-output-php\" class=\"Link--inTextBlock\">\n          wordpress-gallery-output.php\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n<p>So this is an exact copy of the original with nothing actually changed in the filter at this point, you can change what you like to suit your needs, the highlighted line is what controls the link around the image and is not easily manipulated.<\/p>\n<p>So instead of using <a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_get_attachment_link\"><em>wp_get_attachment_link <\/em><\/a>as the <strong>$image_output<\/strong>, you can build the HTML link and use <a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_get_attachment_url\"><em>wp_attachment_url<\/em><\/a> as the <strong>href<\/strong> value for the clicked image and then use <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_get_attachment_image\/\"><em>wp_get_attachment_image<\/em><\/a> for the actual image it is surrounding.<\/p>\n<p>So this would be our new <strong>$image_output<\/strong><\/p>\n<pre>$image_output = \"&lt;a href='\" . wp_get_attachment_url( $id ) . \"'&gt; \" . wp_get_attachment_image($id, $atts['size'], false, $attr ) . \"&lt;\/a&gt;\";<\/pre>\n\n<div id=\"gist37642054\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-image-output-php\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-hack  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"image-output.php content, created by neilgee on 04:21AM on July 10, 2016.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"image-output.php\">\n        <tr class=\"line\">\n          <td id=\"file-image-output-php-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-image-output-php-LC1\" class=\"blob-code blob-code-inner js-file-line\">$image_output = \"&lt;a href='\" . wp_get_attachment_url( $id ) . \"'&gt; \" . wp_get_attachment_image($id, $atts['size'], false, $attr ) . \"&lt;\/a&gt;\";<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c\/raw\/854dc53c3e0748a69f7b6e56ea3e9194e8792421\/image-output.php\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c#file-image-output-php\" class=\"Link--inTextBlock\">\n          image-output.php\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n<h3>Adding a Class or Data Attribute<\/h3>\n<p>Now that the html is editable you can easily add a <em>class<\/em> or <em>data attribute<\/em>.<\/p>\n<p>Say if you wanted a <strong>unique<\/strong>\u00a0class or data attribute for each gallery (if more than one appeared on the page) you can take advantage of the <strong>$instance<\/strong> parameter which is a unique ID of each gallery, which you could append to your class to data attribute value.<\/p>\n<pre>data-gall='gallery-{$instance}'<\/pre>\n<p>or<\/p>\n<pre>class='gallery-class-{$instance}'<\/pre>\n<p>So if more than one gallery existed on the page they would have these values incremented by 1.<\/p>\n\n<div id=\"gist37642054\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-image-output-instance-php\" class=\"file my-2\">\n    \n    <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-hack  \" style=\"overflow: auto\" tabindex=\"0\" role=\"region\" aria-label=\"image-output-instance.php content, created by neilgee on 04:21AM on July 10, 2016.\">\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"%7B%7B%20revealButtonHref%20%7D%7D\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"image-output-instance.php\">\n        <tr class=\"line\">\n          <td id=\"file-image-output-instance-php-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-image-output-instance-php-LC1\" class=\"blob-code blob-code-inner js-file-line\">$image_output = \"&lt;a href='\" . wp_get_attachment_url( $id ) . \"' data-gall='gallery-{$instance}'&gt; \" . wp_get_attachment_image($id, $atts['size'], false, $attr ) . \"&lt;\/a&gt;\";<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c\/raw\/854dc53c3e0748a69f7b6e56ea3e9194e8792421\/image-output-instance.php\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/neilgee\/c2daa5c3ecf84f4a22384ae10920810c#file-image-output-instance-php\" class=\"Link--inTextBlock\">\n          image-output-instance.php\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n\n\n<p>That&#8217;s it, manipulate away!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To\u00a0manipulate the linked images, specifically the links themselves in the WordPress Gallery output for doing things like adding in a CSS class or a data attribute value you can use\u00a0the\u00a0post_gallery filter in\u00a0\/wp-includes\/media.php which\u00a0is the right tool for the job. The filter can be applied like so&#8230; So this is an exact copy of the original &hellip; <a href=\"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Add a Data Attribute to a WordPress Gallery via PHP<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1871","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox\" \/>\n<meta property=\"og:description\" content=\"To\u00a0manipulate the linked images, specifically the links themselves in the WordPress Gallery output for doing things like adding in a CSS class or a data attribute value you can use\u00a0the\u00a0post_gallery filter in\u00a0\/wp-includes\/media.php which\u00a0is the right tool for the job. The filter can be applied like so&#8230; So this is an exact copy of the original &hellip; Continue reading Add a Data Attribute to a WordPress Gallery via PHP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"VenoBox LightBox\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-10T06:42:33+00:00\" \/>\n<meta name=\"author\" content=\"wpbeaches\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wpbeaches\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/\"},\"author\":{\"name\":\"wpbeaches\",\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600\"},\"headline\":\"Add a Data Attribute to a WordPress Gallery via PHP\",\"datePublished\":\"2016-07-10T06:42:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/\"},\"wordCount\":294,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/\",\"url\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/\",\"name\":\"Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox\",\"isPartOf\":{\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png\",\"datePublished\":\"2016-07-10T06:42:33+00:00\",\"author\":{\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600\"},\"breadcrumb\":{\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage\",\"url\":\"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png\",\"contentUrl\":\"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/themes.wpbeaches.com\/venobox\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add a Data Attribute to a WordPress Gallery via PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#website\",\"url\":\"https:\/\/themes.wpbeaches.com\/venobox\/\",\"name\":\"VenoBox LightBox\",\"description\":\"Just another responsive WordPress jQuery lightbox plugin\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/themes.wpbeaches.com\/venobox\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600\",\"name\":\"wpbeaches\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/021b74a55ed390e01233c4ee2c720d1e308e3b995da5750145afce5788731137?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/021b74a55ed390e01233c4ee2c720d1e308e3b995da5750145afce5788731137?s=96&d=mm&r=g\",\"caption\":\"wpbeaches\"},\"description\":\"Share a little biographical information to fill out your profile. This may be shown publicly. Share a little biographical information to fill out your profile. This may be shown publicly. Share a little biographical information to fill out your profile. This may be shown publicly.\",\"url\":\"https:\/\/themes.wpbeaches.com\/venobox\/author\/wpbeaches\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox","og_description":"To\u00a0manipulate the linked images, specifically the links themselves in the WordPress Gallery output for doing things like adding in a CSS class or a data attribute value you can use\u00a0the\u00a0post_gallery filter in\u00a0\/wp-includes\/media.php which\u00a0is the right tool for the job. The filter can be applied like so&#8230; So this is an exact copy of the original &hellip; Continue reading Add a Data Attribute to a WordPress Gallery via PHP","og_url":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/","og_site_name":"VenoBox LightBox","article_published_time":"2016-07-10T06:42:33+00:00","author":"wpbeaches","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wpbeaches","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#article","isPartOf":{"@id":"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/"},"author":{"name":"wpbeaches","@id":"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600"},"headline":"Add a Data Attribute to a WordPress Gallery via PHP","datePublished":"2016-07-10T06:42:33+00:00","mainEntityOfPage":{"@id":"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/"},"wordCount":294,"commentCount":0,"image":{"@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/themes.wpbeaches.com\/venobox\/add-data-attribute-wordpress-gallery-via-php\/","url":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/","name":"Add a Data Attribute to a WordPress Gallery via PHP - VenoBox LightBox","isPartOf":{"@id":"https:\/\/themes.wpbeaches.com\/venobox\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png","datePublished":"2016-07-10T06:42:33+00:00","author":{"@id":"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600"},"breadcrumb":{"@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#primaryimage","url":"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png","contentUrl":"https:\/\/wpbeaches.com\/wp-content\/uploads\/2016\/07\/wordpress-gallery-output-link.png"},{"@type":"BreadcrumbList","@id":"https:\/\/wpbeaches.com\/filtering-gallery-image-output-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/themes.wpbeaches.com\/venobox\/"},{"@type":"ListItem","position":2,"name":"Add a Data Attribute to a WordPress Gallery via PHP"}]},{"@type":"WebSite","@id":"https:\/\/themes.wpbeaches.com\/venobox\/#website","url":"https:\/\/themes.wpbeaches.com\/venobox\/","name":"VenoBox LightBox","description":"Just another responsive WordPress jQuery lightbox plugin","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/themes.wpbeaches.com\/venobox\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/22e5a59937f10e7c75a1a29ead249600","name":"wpbeaches","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/themes.wpbeaches.com\/venobox\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/021b74a55ed390e01233c4ee2c720d1e308e3b995da5750145afce5788731137?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/021b74a55ed390e01233c4ee2c720d1e308e3b995da5750145afce5788731137?s=96&d=mm&r=g","caption":"wpbeaches"},"description":"Share a little biographical information to fill out your profile. This may be shown publicly. Share a little biographical information to fill out your profile. This may be shown publicly. Share a little biographical information to fill out your profile. This may be shown publicly.","url":"https:\/\/themes.wpbeaches.com\/venobox\/author\/wpbeaches\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7HFXn-ub","_links":{"self":[{"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/posts\/1871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/comments?post=1871"}],"version-history":[{"count":1,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/posts\/1871\/revisions"}],"predecessor-version":[{"id":1872,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/posts\/1871\/revisions\/1872"}],"wp:attachment":[{"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/media?parent=1871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/categories?post=1871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themes.wpbeaches.com\/venobox\/wp-json\/wp\/v2\/tags?post=1871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}