Custom Fields
Re-Envisioned
Support MB User Profile Error with User Profile Shortcode

  • Creator
    Topic
  • #20980
    Resolved SL
    Participant

    Whether I paste the shortcode provided in the docs or I used do_shortcode() myself on the php template, I get these errors when trying to use the frontend User Profile. (I replaced my website name with ‘mywebsite’, and I hosting this project locally)

    Warning: Creating default object from empty value in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Shortcodes\Info.php on line 62
    
    Fatal error: Uncaught Error: Call to undefined method stdClass::enqueue() in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Base.php:59 Stack trace: #0 C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Info.php(43): MBUP\Forms\Base->render() #1 C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Shortcodes\Base.php(42): MBUP\Forms\Info->render() #2 C:\xampp\htdocs\www.mywebsite.com\wp-includes\shortcodes.php(343): MBUP\Shortcodes\Base->shortcode(Array, '', 'mb_user_profile...') #3 [internal function]: do_shortcode_tag(Array) #4 C:\xampp\htdocs\www.mywebsite.com\wp-includes\shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(mb_use...', 'do_shortcode_ta...', '\n[mb_user_profi...') #5 C:\xampp\htdocs\www.mywebsite.com\wp-includes\class-wp-hook.php(287): do_shortcode('\n[mb_user_profi...') #6 C:\xampp\htdocs\www.mywebsite.com\wp-includ in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Base.php on line 59
    Warning: Creating default object from empty value in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Shortcodes\Info.php on line 62
    
    Fatal error: Uncaught Error: Call to undefined method stdClass::enqueue() in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Base.php:59 Stack trace: #0 C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Info.php(43): MBUP\Forms\Base->render() #1 C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Shortcodes\Base.php(42): MBUP\Forms\Info->render() #2 C:\xampp\htdocs\www.mywebsite.com\wp-includes\shortcodes.php(343): MBUP\Shortcodes\Base->shortcode(Array, '', 'mb_user_profile...') #3 [internal function]: do_shortcode_tag(Array) #4 C:\xampp\htdocs\www.mywebsite.com\wp-includes\shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(mb_use...', 'do_shortcode_ta...', '[mb_user_profil...') #5 C:\xampp\htdocs\www.mywebsite.com\wp-content\themes\mywiki-child\full-width-template-profile.php(20): do_shortcode('[mb_user_profil...') #6 C:\xampp\htdocs\ in C:\xampp\htdocs\www.mywebsite.com\wp-content\plugins\meta-box-aio\vendor\meta-box\mb-user-profile\src\Forms\Base.php on line 59
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #20987
    Long Nguyen
    Moderator

    Hi there,

    Please make sure that you pass the correct meta box ID to the shortcode.
    [mb_user_profile_info id="meta-box-id"]

    You can get the meta box ID with the Builder https://share.getcloudapp.com/Blu57Xd8
    or add to the code

    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        $meta_boxes[] = array(
            'title' => 'Contact Info',
            'type'  => 'user',
            'id' => 'user-meta-box', // meta box ID
            'fields' => array(
                ...
            ),
        );
        return $meta_boxes;
    } );
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.