Skip to:
Content
Pages
Categories
Search
Top
Bottom

Akismet 4 link limit in posts or whitelist


  • chrishajer
    Participant

    @chrishajer

    Occasionally, a post will get flagged by Akismet as spam, and it’s because of the apparent limitation on links. Posts with 3 links do not get flagged, posts with 4 do. Is there a workaround for that, or barring that, can you whitelist specific posters so their posts are not checked by akismet or they are just passed through, like a whitelist?

    Looking through bb-includes/akismet.php I found this on line 121

    bb_trusted_roles() ... // Don't filter content from users with a trusted role

    How do I set specific users for a trusted role? In user admin, I see only administrator, moderator, member, inactive and blocked. Everyone is a member now.

    Also, I am integrated, if that matters.

    Maybe something in wp_usermeta (bbpress_capabilities or user_level)?

    Could I add ‘member’ to

    ./bb-includes/functions.php:1546: return apply_filters( 'bb_trusted_roles', array('moderator', 'administrator', 'keymaster') ); (knowing the downsides, whatever they may be?)

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • I ran into a similar problem. Specifically, I created a new Role called ‘Superuser’ that has capabilities between Member and Moderator. I don’t want these users ever to be spam-filtered.

    I solved this by replacing this function in /bb-includes/functions.php:

    function bb_trusted_roles() {

    return apply_filters( 'bb_trusted_roles', array('moderator', 'administrator', 'keymaster') );

    }

    with this:

    function bb_trusted_roles() {

    return apply_filters( 'bb_trusted_roles', array('moderator', 'administrator', 'keymaster', 'Superuser') );

    }

    This works, but I hate hacking the core. Is there a way to do this with a plugin? I tried and tried, but I couldn’t figure out how to array_push a new Role on that array. Can somebody help me, perhaps with their superior understanding of how add_filter works? :-)

    Thanks!

    -Bob


    Sam Bauers
    Participant

    @sambauers

    Put this in a plugin file named ‘_addSuperuser.php’ in the my-plugins directory:

    function addSuperuserToArray($array)
    {
    $array[] = 'Superuser';
    return $array;
    }

    add_filter('bb_trusted_roles', 'addSuperuserToArray');

    .

    If there is no my-plugins directory in the bbPress root, just create it. The underscore at the start of the file name should make the file autoload, so it is available without activation in the admin area.

    Thanks Sam! :-)

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