eo_update_venue_meta
since 1.5.0
eo_update_venue_meta( $venue_id, $key, $value, $prev_value = '' )
Update venue meta field based on venue (term) ID.
Use the $prev_value parameter to differentiate between meta fields with the
same key and venue ID. This may be used in place of eo_add_venue_meta() function. The first thing this function will do is make sure that $meta_key
already exists on $venue_id
. If it does not, add_post_meta($venue_id, $meta_key, $meta_value)
is called instead and its result is returned. Returns meta_id if the meta doesn't exist, otherwise returns true on success and false on failure.
If the meta field for the venue does not exist, it will be added.
You should avoid the following 'core' keys:
- _description
- _address
- _city
- _state
- _postcode
- _country
- _lat
- _lng
It is strongly recommended that you prefix your keys with and underscore.
Parameters
int
|
$venue_id |
Venue (term) ID.
|
string
|
$key |
Metadata key.
|
mixed
|
$value |
Metadata value.
|
mixed
|
$prev_value = '' |
Optional. Previous value to check before removing.
|
Return value
bool
|
False on failure, true if success.
|
Changelog
Resources