eo_get_venue_by
since 1.6
eo_get_venue_by( $field, $value, $output = OBJECT, $filter = 'raw' )
Get all venue data from database by venue field and data. This acts as a simple wrapper for `get_term_by()`
Warning: $value
is not escaped for 'name' $field
. You must do it yourself, if required.
If $value
does not exist for that $field
, the return value will be false other the term will be returned.
Example
Get the venue ID by slug (A better way is to use eo_get_venue_id_by_slugorid()
$venue = eo_get_venue_by('slug','my-venue-slug');
if( $venue )
$venue_id = (int) $venue->term_id;
Parameters
string
|
$field |
Either 'slug', 'name', or 'id'
|
string|int
|
$value |
Search for this term value
|
string
|
$output = OBJECT |
Constant OBJECT, ARRAY_A, or ARRAY_N
|
string
|
$filter = 'raw' |
Optional, default is raw or no WordPress defined filter will applied.
|
Return value
mixed
|
Term Row from database. Will return false if $taxonomy does not exist or $term was not found.
|
Changelog