Skip to main content

Post meta reference (bec_unit)

Developer reference: This section is for theme and plugin developers.

Post meta is registered with register_post_meta (REST-visible where noted, sanitized). Use the bec_ prefix for any custom or ACF fields so they stay namespaced and consistent with this plugin.

Post meta (bec_unit)

Meta keyTypeNotes
bec_external_idstringExternal system identifier.
bec_provider_slugstringProvider key (e.g. integration slug).
bec_last_sync_atstringISO 8601 datetime or empty.
bec_sync_enabledbooleanDefault true; controls whether sync runs for this unit.
bec_sync_payloadstringJSON string: last synced remote unit row (after bec_sync_remote_unit). Shown in the admin “Booking engine — synced data” meta box; not exposed via REST by default.
bec_sync_gallery_source_hashstringSHA-256 fingerprint of the ordered remote URL list (legacy + migration; still updated on sync; see Canonical unit fields).
bec_sync_gallery_image_set_hashstringSHA-256 of sorted image key list (set unchanged when only order changes).
bec_sync_gallery_image_order_hashstringSHA-256 of ordered image key list.
Meta keyNotes
_bec_source_urlRemote URL used when this file was last synced.
_bec_gallery_unit_idOwning bec_unit post ID.
bec_gallery_image_keyStable id for this image within the unit.
bec_gallery_file_hashSHA-256 of the local file for deduplication.

Options (get_option)

OptionPurpose
bec_sync_gallery_image_prefixPrepended to auto-generated gallery filenames (default empty).
bec_sync_gallery_image_suffixBetween the unit name slug and the -NN index (default empty).

Core unit fields (bec_core_*)

Canonical semantics shared across providers (name, address, geo, occupancy, times, rooms, bathrooms, description, m², amenities, gallery as attachment IDs). Filled by ProviderInterface::extractCoreUnitFields() on sync; editable in Unit — core fields (canonical). See Canonical unit fields.

Optional mapped fields (per provider / client)

Each provider may declare extra UnitSyncFieldDefinition entries for site-specific meta keys. On sync, those values are written and edited under Booking engine — unit fields (Kross ships with none by default).

  • Extend — filter bec_unit_sync_field_definitions (definitions, provider slug) or implement ProviderInterface::getUnitSyncFieldDefinitions().
  • Slugs scanned — filter bec_unit_sync_provider_slugs (default: kross).
  • Skip sync overwrite — filter bec_sync_apply_mapped_unit_fields (default true).

ACF

If you add Advanced Custom Fields (or similar), prefer field names / keys under the bec_ prefix to avoid collisions with WordPress core, other plugins, and these registered keys.