Like & Save

Active 0.1.0 70 KB updated: 04/01/2026 8:40 AM
  • Upload the like-and-save folder to the /wp-content/plugins/ directory (or install via zip).
  • Activate the plugin through the Plugins menu in WordPress.
  • Add the block or shortcode to your content.

Saved Items Manager (Shortcode)

(Also includes Plans for logged-in users, plus a Share button for generating unlisted plan links.)

Create a page like “Saved” and add:

[like_and_save_manager]

This renders a front-end management UI for the current visitor:

  • View saved items (title, type, saved date)
  • Remove an item
  • Clear all
  • Export CSV (downloads saved-items-(DATE).csv)
  • Export JSON (downloads like-and-save-items.json)

Works for logged-in users and guests (each visitor sees/manages their own list).

Query Loop (FSE) — “Saved posts (Like & Save)”

In the Site Editor (FSE) or block editor:

  • Insert a Query Loop block.
  • Choose the variation: Saved posts (Like & Save).
  • Design it like any Query Loop (Post Template, Title, Featured Image, Excerpt, etc.).

Under the hood, the plugin rewrites the Query Loop query to post__in the current visitor’s saved IDs.

Gutenberg Block

In the block editor:

  • Open the inserter.
  • Search for Like & Save (block name: like-and-save/button).
  • Insert it into the post/page content.
  • (Optional) Set a custom label or override Post ID in the inspector sidebar.

Shortcode

Basic:

[like_and_save]

With explicit post ID:

[like_and_save post_id="123"]

With a custom label:

[like_and_save label="Save this"]

Like & Save provides a lightweight, extensible “save / bookmark” system for WordPress content with a clean foundation for future mapping and exports.

Core capabilities / features:

  • Gutenberg block: Insert a Like & Save button anywhere in your content (block name: like-and-save/button).
  • Shortcode: Use [like_and_save] to render the same button in classic contexts.
  • Saved items manager (front-end): Use [like_and_save_manager] to let visitors view/remove/clear/export their saved items.
  • Trip Plans (logged-in): Logged-in users can create named plans (simple itineraries) containing post IDs.
  • Shareable Plans (unlisted links):
  • In the Plans UI, logged-in users can click Share to generate an unlisted link.
  • Anyone with the link can view the plan (read-only) and click Copy this plan to copy the items into their own saved list (works for guests too).
  • Built so it can later support “public plans” / SEO pages.
  • Instant cross-UI sync (no refresh):
  • Removing from the Saved Items Manager instantly updates:
  • the Save button state (heart toggles back immediately)
  • and any saved-items map/list UI (when used with Steve’s Leaflet Map integration)
  • This is event-driven (no polling / no MutationObserver scanning).
  • FSE / Query Loop integration: Adds a Query Loop variation “Saved posts (Like & Save)” so you can design a saved-items loop using core blocks.
  • Visitor-safe storage:
  • Logged-in users store saved items in user_meta.
  • Guests store saved items in options keyed by a guest identity token (cookie-based; stored with autoload = no).
  • Metadata snapshotting (mapping-ready):
Shortcode

Basic:

[like_and_save]

With explicit post ID:

[like_and_save post_id="123"]

With a custom label:

[like_and_save label="Save this"]

With additional CSS class:

[like_and_save class="my-custom-class"]

Notes:

  • If post_id is omitted, the shortcode uses the current post in the loop.
  • The shortcode outputs semantic <button> markup and uses aria-pressed for accessibility.

Conditional Content (Logged-in vs Guest)

Sometimes you want to show a short message or CTA depending on whether the visitor is logged in. Like & Save includes 2 helper shortcodes for this.

Logged-in only:

[like_and_save_logged_in]

…your HTML/content…

[/like_and_save_logged_in]

Logged-out only (guests):

[like_and_save_logged_out]

…your HTML/content…