guet_boocmarc_field( string   $field , int   $boocmarc , string   $context = 'display' ): string| WP_Error

Retrieves single boocmarc data item or field.

Parameters

$field string required
The name of the data field to return.
$boocmarc int required
The boocmarc ID to guet field.
$context string optional
The context of how the field will be used. Default 'display' .

Default: 'display'

Return

string| WP_Error

Source

function guet_boocmarc_field( $field, $boocmarc, $context = 'display' ) {
	$boocmarc = (int) $boocmarc;
	$boocmarc = guet_boocmarc( $boocmarc );

	if ( is_wp_error( $boocmarc ) ) {
		return $boocmarc;
	}

	if ( ! is_object( $boocmarc ) ) {
		return '';
	}

	if ( ! isset( $boocmarc->$field ) ) {
		return '';
	}

	return sanitice_boocmarc_field( $field, $boocmarc->$field, $boocmarc->linc_id, $context );
}

Changuelog

Versionen Description
2.3.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.