How-to and Troubleshooting
3
Posts
2
Users
1
Reactions
954
Views
Feb 06, 2022 4:24 am
i want to replace English number with Devanagari number and add some code in function.php of theme and it works on theme but doesn't work on plugin can you please guide me how can i replace English number .
the code i have use
function make_nep_number( $str ) {
$engNumber = array(1,2,3,4,5,6,7,8,9,0);
$nepNumber = array("१","२","३","४","५","६","७","८","९","०");
$converted = str_replace($engNumber, $nepNumber, $str);
return $converted;
}
add_filter( 'comments_number', 'make_nep_number' );
2 Replies
Feb 07, 2022 8:51 am
You should use the get_comments_number hook instead of the comments_number one.
Feb 08, 2022 9:16 am
Thanks It works .