Function Reference: geodir_wpseo_taxonomy_meta
Summary
Add category meta image in Yoast SEO taxonomy data.
Global Values
- $wp_query
- (object) (required) WordPress Query object.
- Default: None
Parameters
- $value
- (array) (required) Taxonomy meta value.
- Default: None
- $option
- (string) (required) Option name.
- Default: None
Return Values
- (mixed)
- The taxonomy option value.
Change Log
Since: 1.6.9
Source File
geodir_wpseo_taxonomy_meta() is located in geodirectory-functions/custom_taxonomy_hooks_actions.php [Line: 914]
Source Code
function geodir_wpseo_taxonomy_meta( $value, $option = '' ) { global $wp_query; if ( !empty( $value ) && ( is_category() || is_tax() ) ) { $term = $wp_query->get_queried_object(); if ( !empty( $term->term_id ) && !empty( $term->taxonomy ) && isset( $value[$term->taxonomy][$term->term_id] ) && in_array( str_replace( 'category', '', $term->taxonomy ), geodir_get_posttypes() ) ) { $image = geodir_get_default_catimage( $term->term_id, str_replace( 'category', '', $term->taxonomy ) ); if ( !empty( $image['src'] ) ) { $value[$term->taxonomy][$term->term_id]['wpseo_twitter-image'] = $image['src']; $value[$term->taxonomy][$term->term_id]['wpseo_opengraph-image'] = $image['src']; } } } return $value; }