PluginEndpoints\Router::add_filters PHP Method

add_filters() public method

If one of the registered endpoints is selected, add the required filters.
public add_filters ( ) : boolean
return boolean
    public function add_filters()
    {
        $endpoint = $this->get_requested_endpoint();
        if (!$endpoint) {
            return false;
        }
        // disable cronjobs for this request
        define('DISABLE_WP_CRON', true);
        // filter active plugins
        add_filter('option_active_plugins', function () use($endpoint) {
            return $endpoint->active_plugins;
        });
    }