...
This commit is contained in:
@@ -11,8 +11,12 @@ function cascapedia_st_jules_locale(): string {
|
||||
return str_starts_with( $path, '/en' ) ? 'en' : 'fr';
|
||||
}
|
||||
|
||||
function cascapedia_st_jules_clean_text( ?string $value ): string {
|
||||
return html_entity_decode( (string) $value, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
|
||||
}
|
||||
|
||||
function cascapedia_st_jules_l( ?string $value ): array {
|
||||
$value = (string) $value;
|
||||
$value = cascapedia_st_jules_clean_text( $value );
|
||||
return [ 'fr' => $value, 'en' => $value ];
|
||||
}
|
||||
|
||||
@@ -117,7 +121,7 @@ function cascapedia_st_jules_get_businesses(): array {
|
||||
]);
|
||||
$businesses = array_map( static function ( WP_Post $post ): array {
|
||||
return [
|
||||
'name' => get_the_title( $post ),
|
||||
'name' => cascapedia_st_jules_clean_text( get_the_title( $post ) ),
|
||||
'description' => cascapedia_st_jules_l( wp_strip_all_tags( $post->post_content ) ),
|
||||
'phone' => (string) get_post_meta( $post->ID, 'phone', true ),
|
||||
'email' => (string) get_post_meta( $post->ID, 'email', true ),
|
||||
|
||||
Reference in New Issue
Block a user