JMGallery is built to be extended. Pro is not privileged code: it is an add-on built entirely on the same public hooks you have.

The contract

The full reference ships in the plugin at jmarztech-gallery/docs/hooks.md. It is the authority; this page is the orientation.

Plugins load alphabetically, so an add-on in a folder sorting before jmarztech-gallery/ loads first. Do all your setup on jmzg_loaded, which fires on plugins_loaded once the gallery is ready.

add_action( 'jmzg_loaded', function () {
    // register field types, display keys, settings, REST routes
} );

Naming

Post typejmzg_media
Meta and taxonomy keysjmzg_ + the field key
Optionsjmzg_settings, jmzg_fields, jmzg_displays
REST namespacejmarztech/v1
CSS namespace.jmz-
Classes and functionsjmzg_ and jmzg_

No custom database tables. Items are posts, values are post meta or terms.

The main extension points

Fields

jmzg_field_types registers a type with its storage, whether it holds many values, and whether it is sortable, filterable and caption-able. jmzg_sanitize_field, jmzg_field_value and jmzg_display_field handle writing, reading and formatting. jmzg_meta_query_clause defines how it filters.

A field keeps its stored type and storage even when no loaded code registers that type. It then behaves as text, or as tags if taxonomy-stored, and saving never rewrites it. Build on that: your add-on going missing should not cost the site its data.

Displays

jmzg_display_defaults adds your keys, jmzg_display_sanitize cleans them, and jmzg_display_style_vars, jmzg_display_classes, jmzg_display_attributes, jmzg_display_before and jmzg_display_top put them into the output. Display keys the plugin does not own are never dropped when a display is saved.

Settings

jmzg_settings_defaults and jmzg_settings_sanitize. Keys you own are carried through untouched when settings are saved from a build that cannot see them.

Output

jmzg_card_caption rebuilds one card’s caption from its parts. jmzg_card_prefix and jmzg_single_actions insert markup. jmzg_image_alt controls alt text. Everything returned must already be escaped.

REST

jmzg_rest_routes adds routes under jmarztech/v1. Each entry is [ path, method, callable, optional permission callable ]; the default permission is edit_posts.

The admin app

The admin is a single script, app.js. Enqueue on jmzg_app_enqueue with 'jmz-app' as a dependency, then register through window.jmzApp:

jmzApp.types.mytype = { input(f, v, name, extra) {}, parse(f, el) {}, fmt(f, v) {} };
jmzApp.formatters.push((f, v) => f.key === 'price' ? '$' + v : undefined);
jmzApp.add('display.layout',     (d, H) => '<label>…</label>');
jmzApp.wire('display.layout',    (scope, d, H) => {});
jmzApp.collect('display.layout', (scope, obj, H) => { obj.key = …; });

Slots: display.layout, display.captions, display.sections, display.listitem, csv.import, settings.sections, upload.video. When no add-on fills a slot, the free plugin renders a disabled preview of what an add-on would put there. Switch those off with jmzg_show_upsell.

Templates

Copy templates/archive-photo.php or templates/single-photo.php into your theme to override them. Block themes get both as block templates, plus

100 items
Getting started with the WordPress Dashboard
File Name: Getting started with the WordPress DashboardInfo Videos / Screenshot, Wordpress, Youtube
Choosing and installing a plugin
File Name: Choosing and installing a pluginInfo Videos / Wordpress, Youtube
Introduction to WordPress
File Name: Introduction to WordPressInfo Videos / Wordpress, Youtube
Cat helping owner paint
File Name: Cat helping owner paintInfo Pets / May 30, 2026 / Photo, Screenshot / $1.99
Cute poodle puppy
File Name: Cute poodle puppyInfo Pets / April 11, 2026 / Photo, Screenshot / $0.99
5 kittens huddle together
File Name: 5 kittens huddle togetherInfo Pets / January 15, 2026 / Photo, Screenshot / $1.50
Welsh Corgi in a field
File Name: Welsh Corgi in a fieldInfo Pets / May 30, 2026 / Photo, Screenshot / $0.99
Vizsla Dog with a Beanie
File Name: Vizsla Dog with a BeanieInfo Pets / May 30, 2026 / Photo, Screenshot
Dog and a Cat Looking at Camera
File Name: Dog and a Cat Looking at CameraInfo Pets / May 30, 2026 / Photo, Screenshot
Australian Shepherd “smiling”
File Name: Australian Shepherd “smiling”Info Pets / May 30, 2026 / Photo
Pug mix puppy
File Name: Pug mix puppyInfo Pets / May 30, 2026 / Photo
Border Collie and Cat
File Name: Border Collie and CatInfo Pets / May 30, 2026 / Photo
Orange and White Tabby Cat
File Name: Orange and White Tabby CatInfo Pets / May 30, 2026 / Photo
Dog with sunglasses with sunset in the background
File Name: Dog with sunglasses with sunset in the backgroundInfo Pets / May 23, 2026 / Illustrated
Multiple pets
File Name: Multiple petsInfo Pets / May 23, 2026 / Illustrated
Collage of Dogs and Cats
File Name: Collage of Dogs and CatsInfo Pets / May 23, 2026 / Illustrated
Kitten on top of a dog’s head
File Name: Kitten on top of a dog’s headInfo Pets / May 23, 2026 / Illustrated
2 dogs and 2 cats running in a field
File Name: 2 dogs and 2 cats running in a fieldInfo Pets / May 23, 2026 / Illustrated
2 puppies in a basket
File Name: 2 puppies in a basketInfo Pets / May 23, 2026 / Illustrated
3 cats and a dog on a couch
File Name: 3 cats and a dog on a couchInfo Pets / May 23, 2026 / Illustrated
Dog and cat looking forward
File Name: Dog and cat looking forwardInfo Pets / May 23, 2026 / Illustrated
Collage of dogs and cats
File Name: Collage of dogs and catsInfo Pets / May 23, 2026 / Illustrated
Puppies and Kittens in a field
File Name: Puppies and Kittens in a fieldInfo Pets / May 23, 2026 / Illustrated
Cat, Rabbit, Dog & Parrot
File Name: Cat, Rabbit, Dog & ParrotInfo Pets / May 23, 2026 / Illustrated
and for custom ones.

Translation

Both plugins are fully translatable and ship a POT file in languages/. Text domains are jmarztech-gallery and jmarztech-gallery-pro.