1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?php
namespace SIW;
use SIW\Forms\Form;
use SIW\Forms\Processor_Spam_Check;
class Forms {
protected $forms = [];
public static function init() {
$self = new self();
$self->forms = siw_get_data_file_ids( 'forms' );
add_action( 'init', [ $self, 'register_forms' ] );
add_action( 'init', [ $self, 'register_form_processors' ] );
}
public function register_forms() {
foreach ( $this->forms as $form_id ) {
new Form( $form_id );
}
}
public function register_form_processors() {
new Processor_Spam_Check();
}
}