DOCS

Meta Field

FREE block. Displays a single meta value from any post, or from any organisation/user, anywhere on your site, including inside a Fundations grid. Block ID: get-fund/meta-field.

Meta field example

Why use this

Fundations and WordPress store a lot of information in post meta and user meta that no core block exposes: an organisation’s website, a custom field on a fundraising page, a logo saved against a user account. The Meta Field block reads any of those values by key and renders it, so you can surface custom data on a page or in a Query Loop card without writing a shortcode or a template part.

It reads from more than just Fundations posts. Point it at any public post type’s meta, or switch its source to the post author or the current logged-in user to show organisation and profile data.

What it does

The block resolves a value in three steps: it picks a source (a post, or a user), reads the meta key you chose, and renders it in the format you selected. When editing, a searchable picker lists the meta keys that already exist for the chosen source, and you can also type a brand-new key by hand.

Sources

SourceReads fromNotes
Post metaA post’s postmetaDefaults to the current post (single template or Query Loop item). Set a Post ID to pin it to one specific post.
User / organisationA user’s usermetaChoose Post author (organisation) to read the author of the current fundation, or Current logged-in user. Set a User ID to pin it to one specific user.

Curated organisation and user keys

When the source is User / organisation, the picker leads with a curated list so these keys are selectable even before any user has filled them in:

LabelKey
Organisation: Nameget_fund_organisation_title
Organisation: Descriptionget_fund_organisation_description
Organisation: Colorget_fund_organisation_color
Organisation: Logo URLget_fund_custom_logo
Organisation: Logo (attachment ID)get_fund_custom_logo_id
Organisation: Page URLget_fund_org_url
User: Website URLuser_url
User: Display namedisplay_name

get_fund_org_url is a synthetic key. It is not stored anywhere; it resolves at render time to the author’s organisation page. With Fundations Pro active it points to that organisation’s single page under /organisations/; without Pro it falls back to the author’s posts URL. It is filtered through get_fund_meta_field_user_link, so you can override the target in code.

Formats

FormatRenders as
TextThe raw value, escaped, wrapped in your chosen tag
NumberThe value formatted with a fixed number of decimals
DateThe value passed through a PHP date format
Link (URL)An anchor whose href is the value; the visible text is your Link text (or the URL itself)
ImageAn whose src is the value; accepts a URL or an attachment ID, with max width, max height, corner radius, and alt text

How to use it

  1. Add the Meta Field block from the Fundations category.
  2. Choose a Source: Post meta, or User / organisation.
  3. Search for the meta key in the picker, or type a custom key. For the User source, pick one of the curated organisation keys or type your own.
  4. Choose a Format (Text, Number, Date, Link, or Image).
  5. Set format-specific options: decimals for numbers, a date format string for dates, link text for links, or max width/height and corner radius for images.
  6. Optionally add prefix or suffix text, fallback text, an HTML tag, alignment, and typography, or toggle Link to post to wrap the whole output in a link to its post.

Settings and options

AttributeTypeDefaultDescription
sourcestringpostpost (post meta) or user (user / organisation)
userSourcestringauthorFor the user source: author (post author) or current (logged-in user)
userIdnumber0Pin the user source to a specific user ID (0 = resolve from source)
postIdnumber0Pin the post source to a specific post ID (0 = current post)
metaKeystring(empty)The meta key to read
formatstringtexttext, number, date, url, or image
decimalsnumber0Decimal places for the number format
dateFormatstring(empty)PHP date format for the date format (blank = site default)
linkTextstring(empty)Visible text for the link format (blank = show the URL)
openInNewTabbooleanfalseAdd target="_blank" to link/image links
imageMaxWidthnumber0Max image width in pixels (0 = no limit)
imageMaxHeightnumber0Max image height in pixels (0 = no limit)
imageBorderRadiusnumber0Image corner rounding in pixels
imageAltstring(empty)Image alt text
tagNamestringspanWrapping element for text/number/date output
alignmentstringleftleft, center, or right
prefixTextstring(empty)Plain text before the value
suffixTextstring(empty)Plain text after the value
fallbackTextstring(empty)Shown when the value is empty (if the block is not hidden)
hideIfEmptybooleantrueRender nothing at all when the value is empty and no fallback is set
linkToPostbooleanfalseWrap the output in a link to the resolved post
fontSizenumber0Font size in pixels (0 = inherit)
fontColorstring(empty)Text color
fontWeightnumber0Font weight 100–900 (0 = inherit)

What you can and cannot do

  • You can read meta from any post type, not just Fundations posts, and from the post author or the current user.
  • You can place the block inside a Query Loop so each card shows its own post’s (or author’s) value.
  • You can render the same key as text, a number, a currency-style figure, a date, a link, or an image.
  • Protected meta keys (those a user is not allowed to read) are not exposed by the picker or the block for the user source.
  • The block does not write meta; it only displays it.
  • The searchable key picker lists keys that already exist for the source. A key with no stored value anywhere still works if you type it by hand, it just will not appear in the list until something saves it.

Query Loop support

The Meta Field block declares Query Loop context, so inside a Query Loop or Greenshift query grid each rendered card resolves the value against its own post (and, for the user source, against that post’s author). This is how the organisation archive shows each organisation’s logo, description, and page link from one block placed once in the template.

Developer reference

SymbolTypeNotes
get-fund/meta-fieldblockServer-rendered, FREE, Query Loop aware.
get_fund_org_urlsynthetic keyResolves to the author’s organisation page (Pro) or author posts URL (free).
get_fund_meta_field_user_linkfilterapply_filters( 'get_fund_meta_field_user_link', $url, $user_id, $attributes ). Override the URL the get_fund_org_url key and the user-source Link to post produce. Fundations Pro uses this to point at the /organisations/ page.
GET /wp-json/get-fund/v1/meta-keysREST routeFeeds the editor’s key picker. Requires the edit_posts capability. Accepts post_type, or ?source=user for user meta.

The render logic lives in render_meta_field_block() in includes/class-get-fund-block-editor.php, with format_meta_value(), build_meta_url_html(), and build_meta_image_html() handling each format.