Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nbejansen committed Mar 1, 2022
1 parent 83d4d10 commit 35e4ab6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class BrandingServiceProvider extends ServiceProvider
}
```

_Also the [branding service](./app/Services/BrandingService.php) automatically receives it's dependencies using constructor dependency injection._

#### Hooks & Shortcodes

Each service provider can register WordPress hooks and shortcodes. The hook and shortcode names are automatically namespaced within the application's namespace and the callbacks are bound the instance of the service provider.
Expand All @@ -99,10 +101,10 @@ class UpdateServiceProvider extends ServiceProvider

This service provider registers an action to the WordPress `init` action hook. The `build_update_checker` method automatically recieves it's dependencies because the action callback is prefixed with an @ sign.

_Note: prefixing action callback with an @ sign only works for actions without any arguments._

After all booting methods are executed the service provider runs all callbacks registered to the `<app-namespace>/update/booted` action hook.

_Note: prefixing action callback with an @ sign only works for actions without arguments. The service container does not know how to resolve these arguments._

##### Filters

```php
Expand Down

0 comments on commit 35e4ab6

Please sign in to comment.