This number format is defined by your language; if your site is set to Arabic, that separator will be set to ?
by default, in that string and everywhere in WordPress. This is defined by WordPress itself here:
https://translate.www.ads-software.com/projects/wp/dev/ar/default/?filters%5Bterm%5D=format&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc
If you’d rather have your own separator, you should be able to use a plugin like this one to change the value set for the Arabic translation of number_format_thousands_sep
.
Another alternative is to change that separator only in the string generated by my plugin using the jp_post_views_output
filter. Here is an example of how the filter can be used:
https://www.ads-software.com/support/topic/how-to-display-just-the-number-of-views-without-views-word/#post-12986373
In your case, you’d want to remove the use of the number_format_i18n
function like so:
/**
* customize the output of the Views shortcode.
*
* @param string $view Phrase outputting the number of views.
* @param array $views Number of views.
* @param string $post_id Post ID.
*/
function jeherve_no_i18n_number( $view, $views, $post_id ) {
if ( isset( $views ) && ! empty( $views ) ) {
$view = sprintf(
esc_html(
_n(
'%s view',
'%s views',
$views['total'],
'jp-post-views'
)
),
$views['total']
);
} else {
$view = esc_html__( 'no views', 'jp-post-views' );
}
return $view;
}
add_filter( 'jp_post_views_output', 'jeherve_no_i18n_number', 10, 3 );