PluginProbe
Assistant – Every Day Productivity Apps / 0.3.1
Assistant – Every Day Productivity Apps v0.3.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / Providers / PostTypeServiceProvider.php

PostTypeServiceProvider.php in Assistant – Every Day Productivity Apps 0.3.1, at backend/src/Providers/PostTypeServiceProvider.php

32 lines 675 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace FL\Assistant\Providers;
5
6
7 use FL\Assistant\PostTypes\NotationsPostType;
8 use FL\Assistant\System\Contracts\ServiceProviderAbstract;
9 use System\Contracts\PostTypeAbstract;
10
11 class PostTypeServiceProvider extends ServiceProviderAbstract {
12
13 protected $post_types = [
14 NotationsPostType::class,
15 ];
16
17 /**
18 * @throws \FL\Assistant\System\Container\InjectionException
19 */
20 public function bootstrap() {
21 add_action( 'init', [ $this, 'on_wordpress_init' ] );
22 }
23
24 public function on_wordpress_init() {
25 foreach ( $this->post_types as $post_type ) {
26 /** @var PostTypeAbstract $pt */
27 $pt = $this->injector->make( $post_type );
28 $pt->register();
29 }
30 }
31 }
32