PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / framework / app / wordpress / class-hooks.php

class-hooks.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.8, at includes/framework/app/wordpress/class-hooks.php

35 lines 1020 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation App Framework — WordPress Hooks adapter.
4 *
5 * `filter()` is `apply_filters()`, `action()` is `do_action()`. An
6 * app's seams are therefore ordinary WordPress hooks that any plugin
7 * can attach to with `add_filter()` / `add_action()`.
8 *
9 * @package OpenStation
10 */
11
12 namespace OpenStation\App\WordPress;
13
14 use OpenStation\App\Contracts\Hooks as HooksContract;
15
16 defined( 'ABSPATH' ) || exit;
17
18 /**
19 * WordPress filters and actions.
20 */
21 final class Hooks implements HooksContract {
22
23 /** {@inheritDoc} */
24 public function filter( $hook, $value, ...$args ) {
25 // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores -- The app names the hook; the adapter only relays it.
26 return apply_filters( (string) $hook, $value, ...$args );
27 }
28
29 /** {@inheritDoc} */
30 public function action( $hook, ...$args ) {
31 // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores -- The app names the hook; the adapter only relays it.
32 do_action( (string) $hook, ...$args );
33 }
34 }
35