gdtt_get_post_meta

gdtt_get_post_meta($post_id, $field_name, $atts = array())

  • $post_id: ID for the post to get custom field value.
  • $field_name: name of the custom field.
  • $atts: array with parameters, listed bellow, optional.

Enhanced getting post meta value with same processing as custom field for shortcode implemented by plugin.

  • image: if field is image this attribute is used, value can be ‘url’ or ‘img’.
  • tag: tag to envelop the custom field value.
  • label: display value with label, true or false.
  • class: class to set if the tag is used.
  • style: style to set if the tag is used.
  • term: only for custom field for terms: name, id, slug or link.
  • raw: only for rich editor field: true to not apply content filters.
  • target: only for link field, add value for target attribute: _blank, _top and other frame related values.
  • rel: only for link field, add value for REL attribute
Example:

[php]echo gdtt_get_post_meta(11, ‘my_custom_field’, array(
‘label’ => true, ‘class’ => ‘my_class’
));[/php]

Comments

Leave a Reply