Support » Plugin: Front End PM » use only the user ID instead of the name
use only the user ID instead of the name
-
Hello,
Many thanks for the great plugin!
Is there the possibility to use only the user ID instead of the name/nicknames?
Thank you and best regards,
Daniel
-
At this time the developer has chosen to just use the display_name. I needed the real first and last name plus the email.
What the developer suggested to me was using this plugin:
What this plugin does is replace the existing display_name with what ever you want. It is specifically designed to switch all display_name variables to first and last name. I edited the plugin for my purposes this way to get the desired result for me:
Line 40
$display_name = trim($_POST['first_name'] . " " . $_POST['last_name'] . "--" . $_POST['user_email']);
Line 60
$display_name = trim($info->first_name . ' ' . $info->last_name . '--' . $info->user_email);
In your case you would edit those lines this way:
Line 40
$display_name = trim($_POST['ID']);
Line 60
$display_name = trim($info->ID);
The plugin uses the wp function, get_userdata(), which collects the following data to be used:
ID
user_login
user_pass
user_nicename
user_email
user_url
user_registered
display_name
first_name
last_name
nickname
description
wp_capabilities (array)
admin_color (Theme of your admin page. Default is fresh.)
closedpostboxes_page
primary_blog
rich_editing
source_domainSo, if you want you can change the display name to what ever you want within these parameters. The downside is that any other program that is display_name will also be affected by this change.
A nice feature that may not be too destructive for the FrontendPM design is to replace display_name with one that is specific for Frontend PM (fep_display_name). Then have options to select how you want the name to display in the program. A similar function to the force-first-last plugin could be used to switch this up. But, for now using the force-first-last plugin is what can be used.
Hi @xfact
where you want to use only the user ID instead of the name/nicknames?Hello Cravaus,
Many thanks for the fast and very detailed answer! That sounds good because I use everything else but display_name not 🙂
@shamim Hasan
Actually, this affects only the plugin FEP, because I always use user_first/lastname and user_id/name, but inside the plugin everywhere.Thank you very much for your help!
Best regards,
DanielI have now installed the plugin and adapted according to your description.
It works almost 100% 🙂
Only when I write a new message, I use the following link, in the “To:” is still the display_name displayed instead user_id
<a href='/msg/?fepaction=newmessage&fep_to=$user&message_title= Message for $order_id'>Send Message</a>
Where $user is the user_id
How can I change this?I have another question when I set the ParentMessage status to pending, I get no emails as admin the new messages are in the pending status, is there a solution?
Thank you for your help!
Sorry, I was wrong, it shows the user_name in the “To:” field.. not the display_name..
how can I change that?I would try deleting your cache in your browser. I bet some java script is stuck. The to: field is working fine on my end. So, try that out.
Hello Cravaus,
Thanks for your reply!
I have now tried it with FF and Chrome.
If I’m logged in as an admin, everything works without problems. I have the user_id everywhere.If I am logged in as a normal user, then I get no preference to whom I want to send the new message always the user_name (login name) of the corresponding account in the “to” displayed.
Ok. In dashboard>frontendPM>settings>recipiants tab is “Can users send message to other users.” Checked?
Yes, it’s checked
- The topic ‘use only the user ID instead of the name’ is closed to new replies.