$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Is there a way a usermember can upload a file and link it in his profile page?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin9PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far