Change WordPress user roles and capabilities Forums Bug Reports Network Admin page error, due to ET_BUILDER_DIR in fake_divi_post_type_load()

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4583
    [email protected]
    Participant

    Hello,

    Version 4.40.1
    In Network Admin, the https://<site>/wp-admin/network/users.php?page=users-user-role-editor-pro.php brings up a warning/error for Line 41. It’s the ET_BUILDER_DIR line. If i comment that out, it’s fine.

    Is this piece of code needed at all?

    /**
    *
    * Divi theme does not create custom post type at wp-admin/users.php page | Divi/includes/builder/framework.php::et_builder_should_load_framework()
    * So it’s not available by default at User Role Editor
    *
    */
    private function fake_divi_post_type_load() {
    global $pagenow;

    if (!function_exists( ‘et_builder_should_load_framework’ )) {
    return;
    }
    // Make it for User Role Editor pages only
    if (!($pagenow==’users.php’ && isset($_GET[‘page’]) && $_GET[‘page’]==’users-user-role-editor-pro.php’)) {
    return;
    }

    require ET_BUILDER_DIR . ‘layouts.php’;
    }
    // end of fake_divi_post_type_load()

    #4584
    Vladimir
    Keymaster

    Hi,

    Thanks for this report.

    Yes, this piece of code is needed to provide access to custom post type ‘et_pb_layout’ user capabilities at User Role Editor page when we force it to use own capabilities (‘edit_et_pb_layouts’, etc.) instead of ‘post’ like.

    It seems that it stopped working after of some Divi theme update. I changed line

    
    require ET_BUILDER_DIR . ‘layouts.php’;
    

    to

    
    et_builder_register_layouts();
    

    This change will be available with upcoming version 4.41

    #4597
    Vladimir
    Keymaster

    Did you have a chance to test version 4.41? One of users reported PHP fatal error “Call to undefined function et_builder_register_layouts()”, while this code works fine at my test site with Divi 3.0.98.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.