Description
Determine the tag or category value to use if the given value is not a tag or category slugThe rules for tag and category slugs are… that they are usually all lowercase and contains only letters, numbers, and hyphens. So if we find a period then we can consider it to be a field reference But we need to convert the field value into a tag slug! Note: If the tag is numeric or comma separated then we'll not do any lookup
Usage
bw_query_taxonomy_value( $fieldorvalue );Parameters
- $fieldorvalue
- ( mixed ) required –
Returns
voidSource
File name: oik-fields/shortcodes/oik-related.phpLines:
1 to 30 of 30
function bw_query_taxonomy_value( $fieldorvalue ) { $dotpos = strpos( $fieldorvalue, "." ); bw_trace2( $dotpos, "dotpos"); if ( false !== $dotpos ) { if ( $dotpos ) { // lookup field from noderef - bw_query_fieldref_value // $value = bw_query_fieldref_value( $fieldorvalue ); } else { // get_post_meta if a field name follows // // $field_name = substr( $fieldorvalue, 1 ); bw_trace2( $field_name, "field_name"); if ( $field_name ) { $value = bw_query_field_value( $field_name ); } else { // or get the current tags as in bw_get_posts() **?** @TODO $value = null; } } } else { $value = $fieldorvalue; } bw_trace2( $value, "value" ); return( $value ); }View on GitHub
Invoked by
Calls
1 to 3 of 3
