WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
Fatal error (3 posts)

  1. Mark080959
    Member
    Posted 1 year ago #

    Hi I am using your wonderfull frontend plugin. Though i ran into a bug. Trying the edit users page, I get the next error message:Fatal error: Call to undefined function wpuf_user_edit_profile_form() in /www/wordpress/websiteswork394/drasorayaeu/wp-content/plugins/wp-user-frontend/wpuf-edit-user.php on line 21

    It is correct, i cant find that function anywhere in the package. Is there a way around?

    This is my most important question, the other one is mentioned before and is about uploading a picture.

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. professor99
    Member
    Posted 1 year ago #

    This one is definitely a bug. I think wpuf_user_edit_profile_form() should be $edit_profile->show_form() in wpuf-editprofile.php.

    To change yourself find the file wpuf-edit-user.php and change the function wpuf_edit_users() to this:

    function wpuf_edit_users() {
        global $edit_profile;
    
        ob_start();
        //if user is logged in
        if ( is_user_logged_in() ) {
    
            //this user can edit the users
            if ( current_user_can( 'edit_users' ) ) {
    
                $action = isset( $_GET['action'] ) ? $_GET['action'] : 'show';
                $user_id = isset( $_GET['user_id'] ) ? intval( $_GET['user_id'] ) : 0;
                $userdata = get_userdata( $user_id );
    
                switch ($action) {
                    case 'edit':
                        //if user exists
                        if ( $user_id && $userdata ) {
                            $edit_profile->show_form( $user_id );
                        } else {
                            printf( __( "User doesn't exists", 'wpuf' ) );
                        }
                        break;
    
                    case 'wpuf_add_user':
                        wpuf_add_user();
                        break;
    
                    default: wpuf_show_users();
                }
            } else { // user don't have any permission
                printf( __( "You don't have permission for this purpose", 'wpuf' ) );
            }
        } else { //user is not logged in
            printf( __( "This page is restricted. Please %s to view this page.", 'wpuf' ), wp_loginout( '', false ) );
        }
    
        return ob_get_clean();
    }
  3. Mark080959
    Member
    Posted 1 year ago #

    Works fine with this, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.