Home › Toolset Professional Support › [Resolved] Formatting the output of user_registered shortcode
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Tagged: Views, Views plugin
This topic contains 1 reply, has 2 voices.
Last updated by Christian Cox 2 years, 9 months ago.
Assigned support staff: Christian Cox.
I am using the user_registered attribute to show the date that the user was registered, but I cant chage the way the date is displayed.
It´s always something like "2017-09-18 18:10:44". I wanted it to be 18-09-2017 or 18/09/2017.
How can it be done?
Thanks for your help.
English (English )
Types doesn't offer the ability to customize the format of that date, but you can use a custom shortcode to format it however you'd like. Add the following code to functions.php:
add_shortcode( 'format_reg_date', 'format_reg_date_func');
$user_id = $atts['userid'];
$format = $atts['format'];
$reg_date = date($format, strtotime(get_userdata($user_id)->user_registered));
Then you can use the shortcode like so:
[format_reg_date userid="[wpv-user field='ID']" format="m/d/Y"]
Known issues and solutions
Frequently asked support questions
Support tickets archive
Get help from experienced contractors
Meet Toolset support team
Toolset Customer Support Policy
Need to tell us something about the quality of support
How to remove personal information from your database for support