User-description shortcode doesn't work
-
Hi, to which user meta is [user-description] linked? It seems it doesn’t work if is set on ‘description’…
How can I make it work?
Thank you,
M.
-
Hi hightechware,
Thanks for your message.What notification are you trying to set it up on?
Thanks,
JackNew User Registration – For Admin
The
[user_description]shortcode will output the contents of the ‘Biographical Info’ field in the User’s profile who has just registered.Hope this helps.
Thanks,
JackNo, unfortunately not… I have a form that collect biographical info correctly, but when I use shortcode for email, it doesn’t work. I think it may be a bug… or something in settings that I can’t found.
Thanks for your help,
M.Hi hightechware,
How are you collecting this information?
Is it via a plugin or a theme? I suspect that it’s not being saved before the appropriatecreate_userhook is fired and as such, the information isn’t available in the notifications.Let me know.
Thanks,
JackI use WP Customer Area and I collect them with this custom function:
add_action( ‘user_register’, ‘myplugin_user_register’ );
function myplugin_user_register( $user_id ) {
if ( ! empty( $_POST[‘company’] ) ) {
update_user_meta( $user_id, ‘company’, trim( $_POST[‘company’] ) );
}
if ( ! empty( $_POST[‘user_address’] ) ) {
update_user_meta( $user_id, ‘user_address’, trim( $_POST[‘user_address’] ) );
}
if ( ! empty( $_POST[‘zipcode’] ) ) {
update_user_meta( $user_id, ‘zipcode’, trim( $_POST[‘zipcode’] ) );
}
if ( ! empty( $_POST[‘city’] ) ) {
update_user_meta( $user_id, ‘city’, trim( $_POST[‘city’] ) );
}
if ( ! empty( $_POST[‘country’] ) ) {
update_user_meta( $user_id, ‘country’, trim( $_POST[‘country’] ) );
}
if ( ! empty( $_POST[‘company_telephone’] ) ) {
update_user_meta( $user_id, ‘company_telephone’, trim( $_POST[‘company_telephone’] ) );
}
update_user_meta( $user_id, ‘description’, trim( $_POST[‘company’] ) . ‘ – ‘ . trim( $_POST[‘user_address’] ) . ‘ – ‘ . trim( $_POST[‘zipcode’] ) . ‘ ‘ . trim( $_POST[‘city’] ) . ‘ – ‘ . trim( $_POST[‘country’] ) . ‘ – ‘ . trim( $_POST[‘company_telephone’] ) );}
I collect a lot of custom field from registration form and since your plugin doesn’t not use shortcodes for ACF fields, I decided to put everything in description meta.
Is this hook correct? Do you know a better workaround? Let me know if thers’s a bug in user_description shortcode.
Thank you for your help,
M.Have you seen this? https://betternotificationsforwp.com/downloads/custom-fields/
Ok, I’ve seen that I have to spend some money… Tell me just one thing, is that hook correct to collect user_meta description?
Well, the Custom Fields add-on will currently allow you to use the contents of ACF custom fields in your BNFW notifications for posts / pages / custom post types.
Is the information you’re collecting being stored in the Biographical information textbook when you view a user’s profile? If you can see it there, then it would suggest that it’s working correctly.
Thanks,
JackI see biographical information in user’s profile after registration, but notification field in email is empty…
User Login: [user_login]
User Email: [user_email]
Dati azienda: [user_description]
First and second are ok, third comes blank.
Any suggestion?
Thanks a lot,
M.Ok, I think it’s as I said here:
I suspect that it’s not being saved before the appropriate create_user hook is fired and as such, the information isn’t available in the notifications.
Are you able to change the order of the function to something later? Something like ‘1’ so that it executes first?
Jack
Any tips to do this?
Thks,
M.Thanks a lot, it works!
I just put a priority level (1)…
bye,
M.Hi hightechware,
Great! So pleased.If you like the plugin and the support, please feel free to leave an honest review.
Thanks,
Jack
The topic ‘User-description shortcode doesn't work’ is closed to new replies.