Support » Plugin: Restricted Site Access » PHP warning on Settings > Reading page

  • awilliams500

    (@awilliams500)


    Nice plugin, but when I add a restricted_site_access_is_restricted filter I then get a PHP warning error message on the Settings > Reading page in wp-admin. For example if I add something like the following:

    add_filter( ‘restricted_site_access_is_restricted’, ‘my_allow_access’, 10, 2 );

    function my_allow_access( $is_restricted, $wp ) {
    //do something here
    return $is_restricted;
    }

    Everything works fine, but I get something like the following PHP warning error on the Reading admin page:

    Warning: Missing argument 2 for my_allow_access() …

    This seems to be due to the fact that on line 646 in restricted_site_access.php the following doesn’t include the second argument for the filter:

    $is_restricted = apply_filters( ‘restricted_site_access_is_restricted’, $is_restricted );

    It’s not causing a major problem as far as I can see, but it’s not ideal. There are workarounds, but it would be better if this was fixed.

    Is it necessary to apply the filter in this context? Could this line be removed from restricted_site_access.php?

  • The topic ‘PHP warning on Settings > Reading page’ is closed to new replies.