HAP Artwork Sales (Portal + Catalogue) — v1.3.2
Plugin name
HAP Artwork Sales (Portal + Catalogue)
Purpose
Gives artists a private “sales portal” to offer their submitted artworks for sale and set a price.
Creates/maintains a Catalogue Listing (custom post type) for each artwork that’s for sale, and keeps it in sync.
Provides a public catalogue with image lightbox, ribbons (Available / Reserved / Sold), paging.
Provides a judge/admin console to bulk manage listing statuses (Available/Reserved/Sold).
Sets no-cache headers on pages using these shortcodes (to avoid stale pages when availability changes).
Roles / capabilities
Administrator: full access. On activation the plugin grants admins the capability
hap_manage_sales.Super Judge (role created by this plugin): gets
hap_manage_sales.
Use this for trusted staff who should access the Judge Console.Artists: log in as normal site users; the Sales Portal can optionally be restricted by role/cap (see shortcode).
The Judge Console page requires capability
hap_manage_sales.
The Sales Portal page can be restricted by eitherrole="..."orcap="..."(explained below).
Shortcodes (and attributes)
1) #hap_sales_portal] — Artist Sales Portal
What it does: shows the logged-in artist a grid of their own artworks (from the submissions category), with:
“Offer for sale” toggle
Price entry
One-click Submit my Listing to create/update/remove the catalogue listing as needed
Attributes
role: CSV of roles allowed (e.g.role="pmpro_role_artist,artist"). If provided, the user must have at least one.cap: a capability name required to view (e.g.cap="read_private_posts"). If provided, the user must have it.debug:0|1— when1, shows the viewer’s roles to help troubleshoot access.
Notes
This portal only shows posts authored by the current user in the submissions category (see “Yearly rollover”).
Titles rendered via a helper function remove the “Private:”/“Protected:” prefixes.
2) #hap_for_sale_catalogue] — Public Catalogue
What it does: lists the Catalogue Listings (custom post type hap_listing) with:
Image + lightbox (full-size image on click)
Title, excerpt / artist statement (trimmed), dimensions, price
Availability ribbon: SOLD / RESERVED (shown when applicable)
Enquire button (links to your contact page)
Attributes
per_page: default 9columns: default3(visual only; CSS grid)content_max_words: default75(0 = show full text)
Paging
Uses
?hap_page=2etc. Shows “Page X of Y” with prev/next links.
3) #hap_judge_console] — Judge/Admin Console
What it does: provides a secure table of current Catalogue Listings where approved users can:
See Artwork (source title), Artist, Email, Mobile, Price, Status
Change Status for each listing to Available / Reserved / Sold
Save all changes in one submit
Attributes
status:all|available|reserved|sold— filter view; defaultallper_page: default30page: default1(also reads?hap_jpage=)
Access
Requires capability
hap_manage_sales(admins and Super Judges have this by design).
Data model & mapping
Custom post type
hap_listing— “Catalogue Listings” (publish = visible in public catalogue; draft = hidden)
Keys and statuses used by the plugin
Artist’s original artwork (regular post):
Thumbnail/featured image (used on the listing)
post_title,post_excerpt(used as Medium/summary),post_content(longer statement)Meta:
dimensions— used as Dimensionshap_for_sale— 1 or 0 (artist toggle in portal)hap_sale_price— integer price (AUD)
Catalogue Listing (
hap_listingCPT):post_title— copied from the source artwork title (prefixes removed)thumbnail— copied from the source featured imageMeta:
hap_source_post— source artwork post ID (the link back to the artist’s post)hap_sale_price— price (AUD)hap_sale_status—available|reserved|sold(defaultavailable)
Public catalogue fields shown
Title (from listing)
Statement/excerpt/dimensions (read from source artwork)
Image (from listing featured image → copied from source)
Price (listing meta)
Availability ribbon (listing meta)
Enquire link (see below)
Other constants
Submissions category slug:
25-artwork-submissions(used by the Sales Portal to find the artist’s eligible artworks)Enquiry URL:
/contact/(used for the Enquire button)
Caching
Pages that include any of these shortcodes set no-cache flags (
DONOTCACHEPAGE, etc) to prevent stale “sold”/“reserved” displays.
Plugin pre-requisites
The artist artworks already exist as regular posts (your FPS submission flow creates these).
Each artwork should have:
Featured image (for the catalogue card)
Optional excerpt (often used for Medium) and content (Artist Statement)
Optional dimensions meta
Your contact page exists at
/contact/(or change that constant in code if needed).For the Judge Console, users need the
hap_manage_salescapability.
(Admins get this automatically; the plugin also creates a Super Judge role with this cap.)
Yearly rollover — keeping the Sales Portal happy
Unlike your judges/team plugins, the Sales Portal does not take a category="..." attribute.
It finds the artist’s artworks via a hardcoded constant:
SUBMISSIONS_CAT_SLUG = '25-artwork-submissions'
Use a new submissions category each year
Steps
Create a new category (e.g. “2026 Artwork Submissions”, slug
26-artwork-submissions).Update the plugin constant to match the new slug:
const SUBMISSIONS_CAT_SLUG = '26-artwork-submissions';Ensure new artist submissions for the year are assigned to that category.
Good news:
The public catalogue and judge console don’t depend on the category. They operate on hap_listing posts only, so they continue to work across years without changes.
Handy examples / snippets
Sales Portal (restricted to artists role)
#hap_sales_portal role=“pmpro_role_artist”]
Public Catalogue (default settings)
#hap_for_sale_catalogue]
Judge/Admin Console (Super Judges & Admins)
#hap_judge_console status=“all” per_page=“30”]