Hi @dvdmrnjcbssn
I hope you’re well today!
This is currently not possible out of the box.
There is a chance that it may be possible with a bit of additional custom code but I need to consult that with our Formiantor developers first. I’ve already asked them and I (or one of my colleagues) will update you here soon with more information.
Though I appreciate some patience as our developers are dealing with a lot of complex tasks on daily basis and it may take them a while to respond.
We’ll update you here once we got feedback on this.
Best regards,
Adam
Hi @dvdmrnjcbssn
I hope you are doing well.
Could you please try the following code?
<?php
function wpmudev_add_pdf_column( $column ) {
$column['pdf'] = 'PDF Download';
return $column;
}
add_filter( 'manage_users_columns', 'wpmudev_add_pdf_column' );
function wpmudev_add_pdf_column_row( $val, $column_name, $user_id ) {
switch ($column_name) {
case 'pdf' :
if ( get_the_author_meta( 'pdf', $user_id ) ) {
return '<a target="_blank" href='.wp_get_attachment_url( get_the_author_meta( 'pdf', $user_id ) ).'>Download PDF</a>';
} else {
return '';
}
default:
}
return $val;
}
add_filter( 'manage_users_custom_column', 'wpmudev_add_pdf_column_row', 10, 3 );
Add it as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
In the code get_the_author_meta( ‘pdf’, $user_id ) meta key should be replaced and on upload field show files in media library should be enabled.
https://monosnap.com/file/nM7KUWt6KTmVv85ShuLpUxBIIl0WTN
Let us know the result you got.
Best Regards
Patrick Freitas
Thread Starter
David
(@dvdmrnjcbssn)
Hi @wpmudevsupport12 , thanks for your quick response.
I just tried what you have indicated, and I see the column ‘PDF Download’ on the user page, but when I upload a pdf when I register as a new user, I do not see it in that column. The column is still empty.
Previously you commented that in the code get_the_author_meta( ‘pdf’, $user_id ) I have to replace something? maybe that’s why it doesn’t work. What do I have to replace?
Thanks
Hi @dvdmrnjcbssn
The the get_the_author_meta( ‘pdf’, $user_id ) needs to be replaced with the key you configured in the user meta mapping.
https://monosnap.com/file/LLEfSQhZLITgaSb2sL5EqZzk6LpBbs
In case you hadn’t defined the mapping then only new registration would output the link.
Best Regards
Patrick Freitas