Skip to content

get_aeria_field

Alberto Parziale edited this page Aug 30, 2019 · 1 revision

get_aeria_field

get_aeria_field($post, $metabox, $id)

Description

The method fetches a metabox field for a specific post. While, for single fields, you may use WP's get_post_meta, this method gets really useful when you're looing for multiple fields, like a section or a select field.

Parameters

  • $post - WP post object - Searched field's post.
  • $metabox - string - Searched field's metabox ID.
  • $id - string - Searched field's ID.

Return value

The returned value is the field's value; in case of multiple fields, the returned value is an array containing their children.

Example

function getField ()
{
	$meta = get_aeria_field(get_post(), "metabox1", "input-text");
	return $metas;
}

add_action('aeria_booted', 'getField');

Clone this wiki locally