=== Gallery Tile Links (for Elementor) ===
Contributors: monolight
Tags: elementor, gallery, masonry, links, portfolio
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Give each image in Elementor’s built-in Image Gallery its own URL. Masonry/Classic layouts supported. Server-side, no JS, no order hacks.

== Description ==

**Gallery Tile Links** adds a small **“Gallery Tile Link URL”** field to your **Media Library**.  
When you place those images inside Elementor’s **Image Gallery** (including **Masonry**), the widget will link **each tile** to its own URL.

**Highlights**
- **Per-image link** stored on the media item (reusable across galleries).
- **Per-image target**: choose the same tab (default) or a new tab in Media Library.
- **No JavaScript hacks** – server-side output filter for stability.
- **No dependency on item order** – add, remove, or reorder freely.
- **Masonry / Classic layouts** supported (Elementor Image Gallery).
- **Opt-in**: only galleries with CSS class `gallink` are affected.
- Backward-compatible with older custom fields: `gallink_url` and `portfolio_custom_url`.

**Quick start**
1. Install & activate.
2. In **Media Library** → edit an image → fill **Gallery Tile Link URL**.
3. In Elementor, insert **Image Gallery** → set **Link: Media File** (or Custom URL `#` so anchors are printed).
4. In the widget’s **Advanced → CSS Classes**, enter `gallink`.
Done — each tile opens its own URL instead of the lightbox.


**Video tutorial**

https://www.youtube.com/watch?v=BBqyx7Yriqs

This plugin is an independent, third-party add-on and is not affiliated with, endorsed, or sponsored by Elementor.

== Installation ==
1. Upload the plugin files to `/wp-content/plugins/gallery-tile-links-elementor/` or install via the **Plugins** screen.
2. Activate the plugin through the **Plugins** screen.
3. Edit an image in **Media Library** and set **Gallery Tile Link URL**.
4. In Elementor’s **Image Gallery** widget:
   * **Layout**: Masonry or Classic
   * **Link**: Media File (or Custom URL → `#`)
   * **Advanced → CSS Classes**: `gallink`

== Privacy ==
This plugin does not collect, store, or transmit any personal data. It does not contact external servers or load external assets. All functionality runs on your site.

== FAQ ==
= Can I open a tile link in a new tab? =
Yes. Edit the image in Media Library and set **Gallery Tile Link Target** to **New tab**. This applies to that image wherever its Gallery Tile Link URL is used. Existing links keep opening in the same tab unless you change this setting. The browser decides whether to use a tab or a separate window.

= Does this replace a portfolio widget? =
No – it simply lets you use Elementor’s native Gallery as a lightweight portfolio grid where each image can go to a different page.

= Will this disable the lightbox? =
On widgets marked with `gallink`, lightbox is disabled only for images that have a **Gallery Tile Link URL**. Others keep default behavior.

= Always-visible overlay title? =
Use your theme/widget styles or add a tiny CSS snippet to keep the caption overlay visible.

= Works with Elementor Free or Pro? =
It works with the built-in **Image Gallery** widget (Elementor Free).

= Used an earlier snippet? =
It reads `gallink_url` and `portfolio_custom_url` for backward compatibility. New links are saved under `gtl_url`.

== Screenshots ==
1. Media Library field: **Gallery Tile Link URL**.
2. Elementor Image Gallery settings (Masonry, 3 columns, Link: Media File).
3. Add class `gallink` in **Advanced → CSS Classes**.
4. Frontend masonry grid where each tile opens its own URL.

== Changelog ==
= 1.3 =
* Added a per-image Gallery Tile Link Target setting: same tab (default) or new tab.
* Existing links and galleries retain their previous behavior by default.

= 1.2 =
* Marked as tested up to WordPress 7.0.
* Added a video tutorial link to the plugin readme.

= 1.0.2 =
* Compatibility metadata update: marked as tested up to WordPress 7.0.
* Added compatibility headers to the main plugin file so WordPress.org can read requirements from the plugin header.

= 1.0.1 =
* Plugin Check fixes: removed load_plugin_textdomain(), added /languages with POT, updated `Tested up to` to 6.8, updated Author URI.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==
= 1.3 =
Optional per-image new-tab links. Existing links keep their previous behavior until you change the new target setting in Media Library.

= 1.2 =
Compatibility metadata update for WordPress 7.0 and video tutorial added to readme.

= 1.0.2 =
Compatibility metadata update for WordPress 7.0.

= 1.0.1 =
Compatibility and Plugin Check improvements.
