Support » Plugin: Press Permit Core » PPC (2.3/2.4) inhibits rest_allow_anonymous_comments’

  • add_filter( 'rest_allow_anonymous_comments', '__return_true' );
    wp eval "var_dump(apply_filters( 'rest_allow_anonymous_comments', false ));"
    # expected result: true
    # with PPC (2.3 or 2.4) activated: result is always false
    # deactivate PPC: result is true as it should

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kevin Behrens

    (@kevinb)

    Where / when are you executing the add_filter call? When I put it in the main file of an active plugin, the result is as expected.

    class Server {
        public function initialize() {
            add_action('plugins_loaded', [__CLASS__, 'plugins_loaded']);
       }
      static function plugins_loaded() {
            add_filter( 'rest_allow_anonymous_comments', '__return_true' );
      }
    }
    $x = new \Foo\Server();
    $x->initialize();
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PPC (2.3/2.4) inhibits rest_allow_anonymous_comments’’ is closed to new replies.