Is there a way a usermember can upload a file and link it in his profile page?

admin2025-06-03  4

I would like to know if it's possible, with MemberPress or other plugin, for a member to upload an audio file and create a link on their profile page so other members can download the file.

Thanks a lot!

neuhaus3000

I would like to know if it's possible, with MemberPress or other plugin, for a member to upload an audio file and create a link on their profile page so other members can download the file.

Thanks a lot!

neuhaus3000

Share Improve this question edited Feb 8, 2019 at 21:53 rudtek 6,4035 gold badges30 silver badges52 bronze badges asked Feb 8, 2019 at 20:27 Jacques GoudreauJacques Goudreau 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

Yes, this is possible. You would need to hook show_user_profile - from /wp-admin/user-edit.php:

if ( IS_PROFILE_PAGE ) {
    /**
     * Fires after the 'About Yourself' settings table on the 'Your Profile' editing screen.
     *
     * The action only fires if the current user is editing their own profile.
     *
     * @since 2.0.0
     *
     * @param WP_User $profileuser The current WP_User object.
     */
    do_action( 'show_user_profile', $profileuser );
} else {
    // Snip...

This will allow you to display your upload form. Then, you need to hook into personal_options_update to update the user's profile with the data:

if ( IS_PROFILE_PAGE ) {
    /**
     * Fires before the page loads on the 'Your Profile' editing screen.
     *
     * The action only fires if the current user is editing their own profile.
     *
     * @since 2.0.0
     *
     * @param int $user_id The user ID.
     */
    do_action( 'personal_options_update', $user_id );
} else {
    // Snip...

Finally, once you have that all working, you can display the information on your users' profile pages.

There may also be plugins to do the same thing, but I don't think it would be too much to roll your own.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748926374a314879.html

最新回复(0)