boot(); } return self::$instance; } /** * Register hooks. */ private function boot() { Install::maybe_upgrade(); $this->fields = new Registry(); ( new Assets() )->register(); ( new Shortcode() )->register(); ( new Block() )->register(); ( new Preview() )->register(); ( new FallbackHandler() )->register(); ( new Retention() )->register(); add_action( 'rest_api_init', static function () { ( new FormsController() )->register_routes(); ( new EntriesController() )->register_routes(); ( new SubmitController() )->register_routes(); ( new SettingsController() )->register_routes(); } ); if ( is_admin() ) { ( new Admin() )->register(); ( new Exporter() )->register(); } /** * Fires after Fillaro has loaded. Add-ons hook here. * * @param Plugin $plugin Plugin instance. */ do_action( 'fillaro/loaded', $this ); } /** * Capability required to manage forms and entries. * * @return string */ public static function capability() { /** * Filters the capability that manages forms and entries. * * @param string $capability Default 'manage_options'. */ return (string) apply_filters( 'fillaro/capability', 'manage_options' ); } }