Hello Adam,
‘geodir_listinginfo_request’ filters the data that need be saved in listing detail table. See desc https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/post_functions.php#L601
You code shows that you want to filter tags data that saved in detail table. But tags are also a term taxonomy of the listing, so you have to set tags in term taxonomy as well.
Check following code snippet
function gd_override_tags( $listing_info, $post_id ) {
if ( !isset( $listing_info['post_tags'] ) ) {
return $listing_info;
}
$post_tags_array = array( 'my tag', 'my another tag' ); // Your tags here.
$listing_info['post_tags'] = implode( ",", $post_tags_array );
if ($post_id > 0) {
$tag_taxonomy = get_post_type( $post_id ) . '_tags';
// Set listing tag terms
wp_set_object_terms( $post_id, $post_tags_array, $tag_taxonomy ); // Ex: $post_tags_array => array('test', 'mytest'), $tag_taxonomy => 'gd_place_tags'
}
return $listing_info;
}
add_filter( 'geodir_listinginfo_request', 'gd_override_tags', 10, 2 );
Thanks,
Kiran