=== Indie49 Copy Post Link ===
Contributors: indie49
Tags: copy link, permalink, clipboard, bulk actions, custom post type
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Copy the links of your posts, pages, categories and tags from the admin list, one at a time or several at once, without opening them.

== Description ==

Adds a **Copy link** action to the rows of the admin lists of posts, pages, categories, tags, custom post types and custom taxonomies, alongside Edit, Quick Edit and View. One click puts the link on your clipboard, and the action turns green for a moment to confirm it.

Need many links? Tick the rows, choose **Copy links** in Bulk actions and press Apply. All their links are copied at once, one per line and in the order of the list, ready to paste into a spreadsheet, a message or a document.

* Works with posts, pages and **custom post types**: the extra content types that themes and plugins add, such as products, events, recipes, portfolios or directory listings.
* Works with **categories, tags and custom taxonomies**, such as product categories or event locations.
* Shown only where the link is public and final: published, private and custom public statuses for content, and taxonomies with public archives.
* No settings, no tracking, no ads and no external requests. Bulk copy runs in your browser without reloading the page.

= For developers =

Four filters. The first two receive the post, the last two the term:

* `indie49_copy_post_link_enabled` decides whether the action is shown for a post.
* `indie49_copy_post_link_url` changes the URL copied for a post.
* `indie49_copy_post_link_term_enabled` decides whether the action is shown for a term.
* `indie49_copy_post_link_term_url` changes the URL copied for a term.

Bulk copy uses the same links, so the filters apply to it too.

`add_filter( 'indie49_copy_post_link_enabled', function ( $enabled, $post ) { return $enabled && 'product' !== $post->post_type; }, 10, 2 );`

`add_filter( 'indie49_copy_post_link_url', function ( $url, $post ) { return add_query_arg( 'utm_source', 'newsletter', $url ); }, 10, 2 );`

== Installation ==

1. Install the plugin from Plugins → Add New, or upload the `indie49-copy-post-link` folder to `/wp-content/plugins/`.
2. Activate it.
3. Go to Posts → All Posts, Posts → Categories, or the list of any other content type or taxonomy, and move the mouse over a row.

== Frequently Asked Questions ==

= How do I copy several links at once? =

Tick the rows you want, choose Copy links in the Bulk actions menu, above or below the list, and press Apply. A notice tells you how many links were copied. Selected items without a public link, such as drafts, are skipped and counted separately.

= Does it work with custom post types? =

Yes. Any content type with public URLs that uses the standard WordPress list gets the action, whether it comes from your theme, from a plugin or from your own code. Content types without public URLs, such as form entries or menu items, are left alone.

= Does it work with categories and tags? =

Yes, and with any custom taxonomy that has public archive pages. Taxonomies used only internally by plugins are left alone.

= Why is there no Copy link on drafts? =

A draft or a scheduled post does not have its final address yet. Until it is published, WordPress only gives it a temporary link that visitors cannot open, not the permalink people will see.

= Why is the action blue instead of another color? =

It follows the WordPress admin: actions are blue, destructive actions such as Trash are red, and confirmations are green. It also respects the admin color scheme each user chooses.

= Does it work without HTTPS? =

Yes. It uses the clipboard library bundled with WordPress, the same one behind Copy URL in the Media Library. On HTTPS sites, if your browser refuses to copy several links, the notice shows them in a box so you can copy them by hand.

= Can I use the keyboard? =

Yes. Tab to the row, reach Copy link and press Enter. Screen readers announce when links have been copied.

== Screenshots ==

1. Copy link sits next to the other row actions in the posts list.
2. The action turns green for a moment to confirm the link is on your clipboard.
3. Copy links in Bulk actions copies the links of all selected rows at once, one per line.
4. Categories, tags and custom taxonomies get the same Copy link action.

== Changelog ==

= 1.2.3 =
* Rebranding: the plugin is now Indie49 Copy Post Link. The plugin folder, text domain, filters and function names use the indie49-copy-post-link and indie49_copy_post_link prefixes.

= 1.2.1 =
* Plugin URI now points to the plugin page on indie49.com.
* Clearer readme: what happens with drafts, the manual copy box on HTTPS sites and which admin lists get the action.

= 1.2.0 =
* New Copy links bulk action: copy the links of all selected rows at once, one per line.

= 1.1.0 =
* Copy link for categories, tags and custom taxonomies with public archives.
* New `indie49_copy_post_link_term_enabled` and `indie49_copy_post_link_term_url` filters.

= 1.0.2 =
* Works with custom post statuses registered as public.
* Posts without a title are announced as "(no title)" to screen readers.
* New `indie49_copy_post_link_url` filter to change the copied URL.
* Scripts and styles load only on lists that can show the action.

= 1.0.1 =
* Copied! turns green for a moment, like Copy URL in the Media Library.
* Clearer description of custom post type support.

= 1.0.0 =
* First release.
