You appear to be a bot. Output may be restricted
Description
Return custom field post meta data.
Return only the first value of custom field. Return empty string if field is blank or not set.
Usage
$string|bool = genesis_get_custom_field( $field, $post_id );
Parameters
- $field
- ( string ) required – Custom field key.
- $post_id
- ( int ) optional – Optional. Post ID to use for Post Meta lookup, defaults to `get_the_ID()`.
Returns
string|bool Return value or empty string on failure.
Source
File name: genesis/lib/functions/options.php
Lines:
1 to 19 of 19
function genesis_get_custom_field( $field, $post_id = null ) { // Use get_the_ID() if no $post_id is specified. $post_id = empty( $post_id ) ? get_the_ID() : $post_id; if ( ! $post_id ) { return ''; } $custom_field = get_post_meta( $post_id, $field, true ); if ( ! $custom_field ) { return ''; } return is_array( $custom_field ) ? $custom_field : wp_kses_decode_entities( $custom_field ); }