WordPress.org

Ready to get started?Download WordPress

Forums

More Types
Call to a member function add_cap() on a non-object (3 posts)

  1. Jason Judge
    Member
    Posted 3 years ago #

    This error has been logged three months ago, and still seems to be affecting this plugin:

    Fatal error: Call to a member function add_cap() on a non-object in .../wp-content/plugins/more-types/more-types-object.php on line 135

    For me, it works when logged in, but results in a completely blank screen for anonymous visitors.

  2. Jason Judge
    Member
    Posted 3 years ago #

    My work around is to add a condition to line 135 of the more-types-object.php script:

    $wp_roles->add_cap($role, $capability);

    changed to:

    if (is_object($wp_roles)) $wp_roles->add_cap($role, $capability);

    Although this works now, it may be back at the next plugin upgrade, and I am not sure what capabilities are removed through that condition.

  3. jalancast
    Member
    Posted 3 years ago #

    judgej - Thanks a lot for posting yourfix. Unfortunately, I needed it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags