File Editor
Directories:
.. (Back)
Access
Admin
Emails
Forms
Helpers
Integrations
Lite
Providers
Tasks
Files:
Loader.php
Migrations.php
WPForms.php
Create New File
Create
Edit File: Loader.php
<?php namespace WPForms; /** * WPForms Class Loader. * * @since 1.5.8 */ class Loader { /** * Classes to register. * * @var array */ private $classes = array(); /** * Loader init. * * @since 1.5.8 */ public function init() { $this->populate_classes(); wpforms()->register_bulk( $this->classes ); } /** * Populate the classes to register. * * @since 1.5.8 */ protected function populate_classes() { $this->populate_admin(); $this->populate_migrations(); $this->populate_capabilities(); $this->populate_tasks(); } /** * Populate Admin related classes. * * @since 1.6.0 */ private function populate_admin() { array_push( $this->classes, [ 'name' => 'Admin\AdminBarMenu', ], [ 'name' => 'Admin\Notifications', 'id' => 'notifications', ], [ 'name' => 'Admin\Entries\Edit', 'id' => 'entries_edit', 'hook' => 'admin_init', ] ); } /** * Populate migration classes. * * @since 1.5.9 */ private function populate_migrations() { $this->classes[] = [ 'name' => 'Migrations', 'hook' => 'plugins_loaded', ]; } /** * Populate access management (capabilities) classes. * * @since 1.5.8 */ private function populate_capabilities() { array_push( $this->classes, [ 'name' => 'Access\Capabilities', 'id' => 'access', 'hook' => 'plugins_loaded', ], [ 'name' => 'Access\Integrations', ], [ 'name' => 'Admin\Settings\Access', 'condition' => is_admin(), ] ); } /** * Populate tasks related classes. * * @since 1.5.9 */ private function populate_tasks() { array_push( $this->classes, [ 'name' => 'Tasks\Tasks', 'id' => 'tasks', 'hook' => 'init', ], [ 'name' => 'Tasks\Meta', 'id' => 'tasks_meta', 'hook' => false, 'run' => false, ] ); } }
Save Changes
Rename File
Rename