Remove flag link from anspress question and answer

If your site is private or for any reason there is no use of flag functionality then you can add below code to you theme function.php to remove flag link.

Loading Gist...

Also, if you are using our theme then make sure to create a child theme and paste this code in child-theme function.php.

1 Comment

  1. Hi,
    Currently on Version 4.3.2 the filter has changed a lot so you can use the next code inside functions.php to remove the flag link if the code above doesn’t work:

    function custom_post_actions($actions)
    {
    return array_filter($actions, function ($action) {
    return $action[‘cb’] != ‘flag’;
    });
    }
    add_filter(‘ap_post_actions’, ‘custom_post_actions’);

    Reply

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment