Hooks and constants
Everything here is in the plugin's own namespace. WordPress's own hooks for
taxonomies, terms and attachments work normally, because folders are terms — so
before reaching for anything on this page, check whether get_terms,
wp_set_object_terms or pre_get_posts already does what you want.
Prefix: vergeml_. Text domain: vergelabs-media-library.
Filters #
Folders and assignment #
| Filter | Default | Signature |
|---|---|---|
vergeml_auto_assign_terms | the parent's terms | ( array $terms, int $attachment_id, WP_Post $parent, string $taxonomy ) |
vergeml_multilingual_shared_folders | true | ( bool $shared ) — return false for per-language folders |
vergeml_replace_parent_column | true | ( bool $replace ) — whether to replace core's parent column |
Smart folders and the scan #
| Filter | Default | Signature |
|---|---|---|
vergeml_smart_folders | the five built-in | ( array $folders ) |
vergeml_smart_query_args | per key | ( array $args, string $key ) |
vergeml_smart_count_branches | array() | ( array $branches ) — each array( 'sql' => …, 'args' => array() ) |
vergeml_smart_count_exclude | '' | ( string $sql ) |
vergeml_scan_chunk | 200 | ( int $posts_per_chunk ) |
vergeml_large_file_bytes | MB_IN_BYTES | ( int $bytes ) |
Importing #
| Filter | Default | Signature |
|---|---|---|
vergeml_import_sources | seven plugins | ( array $sources ) |
vergeml_import_chunk | 500 | ( int $rows_per_chunk ) |
The AI layer #
| Filter | Default | Signature |
|---|---|---|
vergeml_ai_parallel | 8 | ( int $in_flight ) — describe calls at once |
vergeml_meaning_budget_ms | 2000 | ( int $ms ) — time a meaning search may spend, floor 500 |
vergeml_autofile_vector | null | ( ?array $vector, int $attachment_id ) — supply your own vector |
vergeml_nl_parse | null | ( ?array $intent, string $text ) — put your own parser in front of the built-in one |
A vergeml_nl_parse implementation still has to name a verb from the allowlist
(move, tag, rename, create) and a selection the plugin can resolve, and it still
cannot run anything by itself. See Say what you want.
Sorting runs and clustering #
| Filter | Default | Signature |
|---|---|---|
vergeml_librarian_taxonomy | your primary folder taxonomy | ( string $taxonomy ) |
vergeml_librarian_chunk | 25 | ( int $files ) — floor of 5 |
vergeml_organize_batch | 200 | ( int $files ) — clamped to 50…2000 |
vergeml_organize_dims | 64 | ( int $dims ) — minimum 4 |
vergeml_organize_width | 6 | ( int $folders_per_level ) — minimum 2 |
vergeml_organize_max_depth | 3 | ( int $levels ) — minimum 1 |
vergeml_organize_min_branch | 5 | ( int $files ) — minimum 1 |
vergeml_organize_max_branch | 50 | ( int $files ) — minimum 2 |
vergeml_organize_outlier | 3.0 | ( float $distance ) |
Screens and reporting #
| Filter | Default | Signature |
|---|---|---|
vergeml_journey_stages | the dashboard's stages | ( array $stages ) |
vergeml_journey_todo | the next action | ( array $todo ) |
vergeml_help_texts | the built-in help copy | ( array $texts ) |
vergeml_system_report | the support report | ( array $report ) |
Actions #
| Action | When | Passed |
|---|---|---|
vergeml_activate | On activation, after options are written | — |
vergeml_set_options | When options are (re)written, including migrations | — |
vergeml_set_site_options | The multisite equivalent | — |
vergeml_extend_settings_page | Inside the settings screen | — |
vergeml_admin_home_cards | On the Dashboard, where cards are printed | — |
vergeml_ai_page_cards | On the AI screen | — |
vergeml_health_page_cards | On the Duplicates screen | — |
vergeml_librarian_page_top | Above the Folders screen | — |
vergeml_librarian_page_cards | On the Folders screen | — |
Add-on integration points also exist for options and transients an add-on registers
(vergeml_pro_add_options, vergeml_pro_add_transients) so a complete cleanup
removes them too.
Constants #
Set these in wp-config.php #
| Constant | Effect |
|---|---|
VERGEML_AI_SERVICE | Point the AI client at another base URL. Development only. Non-HTTPS values are refused. There is deliberately no filter for this: requests carry your licence key, and a filter would let any co-installed plugin redirect them |
VERGEML_AI_MOCK | Force demo mode. Captions are invented locally and nothing is sent |
VERGEML_AI_ALLOW_NONPROD | Allow describing from a non-production environment. Off by default so a clone cannot spend your balance |
VERGEML_NO_WATCHDOG | Do not install the fatal-error handler |
VERGEML_SAFE_MODE | Force safe mode on |
Defined by the plugin, overridable before load #
Useful ones. Every value below is the shipped default.
| Constant | Default | What it controls |
|---|---|---|
VERGEML_VERSION | 4.1.0 | — |
VERGEML_MENU | vergelabs-media | The top-level menu slug |
VERGEML_REST_NS | vergeml/v1 | REST namespace |
VERGEML_AI_PARALLEL | 8 | Describe calls in flight |
VERGEML_AI_STEP_MAX | 24 | Files per on-screen step |
VERGEML_AI_RUN_CHUNK | 8 | Files per background chunk |
VERGEML_AI_RUN_BUDGET | 20 | Seconds of work per cron tick |
VERGEML_AI_RUN_GAP | 30 | Seconds before the next tick is due |
VERGEML_AI_HOLD_SECONDS | 600 | A file described this recently is held back |
VERGEML_INDEX_BATCH | 100 | Index rows read per pass |
VERGEML_MEANING_BUDGET | 2000 | Milliseconds a meaning search may spend |
VERGEML_MEANING_CHUNK | 5000 | Projection rows read per query |
VERGEML_MEANING_FLOOR | 0.22 | Similarity below which a hit is not a hit |
VERGEML_HEALTH_BATCH | 25 | Attachments hashed per batch |
VERGEML_HEALTH_CAP | 200 | Maximum per request |
VERGEML_HEALTH_NEAR | 5 | Hamming distance for a near-duplicate |
VERGEML_HEALTH_MIN_SIDE | 64 | Smallest image the dHash will judge |
VERGEML_QUARANTINE_DAYS | 30 | The floor before a set-aside file is even eligible. Not a setting |
VERGEML_AUTOFILE_EARN | 5 | Accepted suggestions before a folder may file on its own |
VERGEML_AUTOFILE_MARGIN | 1.25 | How much nearer the winning folder must be |
VERGEML_AUTOFILE_REACH | 1.5 | Beyond this, no suggestion at all |
VERGEML_CSV_MAX_ROWS | 200000 | CSV import ceiling |
VERGEML_CSV_MAX_DEPTH | 12 | CSV nesting ceiling |
Working with folders directly #
You rarely need any of the above. Folders are terms:
// Which folders is this file in?
$folders = wp_get_object_terms( $attachment_id, 'media_category' );
// File it into one, keeping the others.
wp_set_object_terms( $attachment_id, array( $term_id ), 'media_category', true );
// Every file in a folder, and its sub-folders.
$q = new WP_Query( array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'posts_per_page' => -1,
'tax_query' => array( array(
'taxonomy' => 'media_category',
'field' => 'term_id',
'terms' => $term_id,
'include_children' => true,
) ),
) );
Colour and manual order are term meta: vergeml_color and vergeml_order.
Written from version 3.15.0 of the plugin. Last updated 2026-10-02. All documentation · Legal · Support