Ok, I've been searching for over an hour for something I thought (and still think) is pretty simple. I need to change the title Users to Customers in the admin for a client. I can and have easily hooked into the menus and changed it there. But it still shows up as Users on the main users page or when you add a new user (Add new User should be Add New Customer).
I tried something like this in an init action but no dice ...
$labels = &$wp_post_types['users']->labels;
$labels->name = 'Customer';
I've got to be missing some very simple filter. Thanks for your help!
Ok, I've been searching for over an hour for something I thought (and still think) is pretty simple. I need to change the title Users to Customers in the admin for a client. I can and have easily hooked into the menus and changed it there. But it still shows up as Users on the main users page or when you add a new user (Add new User should be Add New Customer).
I tried something like this in an init action but no dice ...
$labels = &$wp_post_types['users']->labels;
$labels->name = 'Customer';
I've got to be missing some very simple filter. Thanks for your help!
Share Improve this question asked Nov 21, 2019 at 2:57 K_CK_C 1111 bronze badge 2 |1 Answer
Reset to default 0As suggested by Sally CJ in the comments. gettext was the easiest and fastest way to make this possible.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744958160a4603322.html
users.php
anduser-new.php
, then 'users' are not post type; 'users' have its own table. And you can use thegettext
filter to modify the text 'User'/'Users'/etc. Just search for__()
and_e()
calls in the relevant PHP file. – Sally CJ Commented Nov 21, 2019 at 6:35