cp_get_relationship_meta( int $relationship_id, string $meta_key = '', bool $single = '' )
Retrieves metadata for a relationship.
Parameters
- $relationship_id
-
(Required) Relationship ID.
- $meta_key
-
(Optional) The meta key to retrieve. By default, returns data for all keys.
Default value: ''
- $single
-
(Optional) Whether to return a single value.<br> This parameter has no effect if
$key
is not specified.<br> Default false.Default value: ''
Return
(mixed) An array of values if $single
is false.<br> The value of the meta field if $single
is true.<br> False for an invalid $term_id
(non-numeric, zero, or negative value).<br> An empty string if a valid but non-existing term ID is passed.
Source
File: wp-includes/object-relationships.php
function cp_get_relationship_meta( $relationship_id, $meta_key = '', $single = '' ) {
return get_metadata( 'object_relationship', $relationship_id, $meta_key, $single );
}
Changelog
Version | Description |
---|---|
CP-2.2.0 | Introduced. CP-2.2.0 |