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 ); }