PluginProbe
Assistant – Every Day Productivity Apps / trunk
Assistant – Every Day Productivity Apps vtrunk
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 trunk, at backend/src/Providers/PostTypeServiceProvider.php

34 lines 771 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\PostTypes\CodePostType;
9 use FL\Assistant\System\Contracts\ServiceProviderAbstract;
10 use System\Contracts\PostTypeAbstract;
11
12 class PostTypeServiceProvider extends ServiceProviderAbstract {
13
14 protected $post_types = [
15 NotationsPostType::class,
16 CodePostType::class
17 ];
18
19 /**
20 * @throws \FL\Assistant\System\Container\InjectionException
21 */
22 public function bootstrap() {
23 add_action( 'init', [ $this, 'on_wordpress_init' ] );
24 }
25
26 public function on_wordpress_init() {
27 foreach ( $this->post_types as $post_type ) {
28 /** @var PostTypeAbstract $pt */
29 $pt = $this->injector->make( $post_type );
30 $pt->register();
31 }
32 }
33 }
34