<?php
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'pais' == $params['facet_name'] ) {
require_once PODS_DIR . 'classes/fields/pick.php';
$pick = new PodsField_Pick();
$countries = $pick->data_countries();
$label = $params['facet_display_value'];
if ( isset( $countries[ $label ] ) ) {
$params['facet_display_value'] = $countries[ $label ];
}
}
return $params;
}, 10, 2 );