Functions — Reference — Pure Metafields

Docs/Reference/Functions

Functions

For usage examples, see Developer Guide → Helper Functions.

FunctionReturns
tpmeta_get_option( $key, $default = '' )An option panel field's stored value (theme_mod), or $default.
get_theme_mod( $key, $default = false )WordPress core equivalent — interchangeable with the above for scalar fields.
tpmeta_get_repeater_rows( $field_id, $default = array() )Decoded array of rows for an option-panel repeater, defaults merged in.
tpmeta_field( $meta_key, $post_id = null )A metabox field's stored value (post_meta) for a post; falls back to the field default, or false.
tpmeta_image_field( $key, $post_id = null )A metabox image field, shaped per its return_format.
tpmeta_image_option( $key, $default = '', $size = 'full' )An option-panel image field, with portable URL tokens resolved.
tpmeta_image( $image_id, $size = 'full' )Any attachment ID → ['url' => …, 'alt' => …].
tpmeta_gallery_field( $key, $post_id = null )A metabox gallery field as an array of image arrays.
tpmeta_gallery_images( $gallery_value, $size = 'full' )A raw gallery value (CSV/array of IDs) resolved to image arrays.
Not listed here

Functions like tpmeta_compare(), tpmeta_normalise_conditional(), the repeater default/decode filter registration functions, and tpmeta_resolve_image_url() are internal plumbing the plugin calls itself — not part of the public API this guide documents.