Asset
5 years ago
HelpTab
5 years ago
Main
5 years ago
Menu
5 years ago
Notice
5 years ago
Preference
5 years ago
ScreenOption
5 years ago
Section
5 years ago
AddonStatus.php
5 years ago
Admin.php
5 years ago
AdminNetwork.php
5 years ago
AdminScripts.php
5 years ago
Banner.php
5 years ago
HelpTab.php
5 years ago
Helpable.php
5 years ago
MainFactory.php
5 years ago
MainFactoryInterface.php
5 years ago
Menu.php
5 years ago
MenuFactory.php
5 years ago
MenuFactoryInterface.php
5 years ago
NetworkRequestHandler.php
5 years ago
Page.php
5 years ago
PageFactory.php
5 years ago
PageFactoryInterface.php
5 years ago
PageRequestHandler.php
5 years ago
RequestHandler.php
5 years ago
RequestHandlerInterface.php
5 years ago
ScreenOption.php
5 years ago
ScreenOptions.php
5 years ago
Section.php
5 years ago
SectionCollection.php
5 years ago
Table.php
5 years ago
Tooltip.php
5 years ago
WpMenuFactory.php
5 years ago
NetworkRequestHandler.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Admin; |
| 4 | |
| 5 | use AC; |
| 6 | use AC\Request; |
| 7 | |
| 8 | class NetworkRequestHandler implements RequestHandlerInterface { |
| 9 | |
| 10 | /** |
| 11 | * @var RequestHandlerInterface[] |
| 12 | */ |
| 13 | public static $handlers; |
| 14 | |
| 15 | public static function add_handler( RequestHandlerInterface $handler ) { |
| 16 | self::$handlers[] = $handler; |
| 17 | } |
| 18 | |
| 19 | public function handle( Request $request ) { |
| 20 | foreach ( array_reverse( self::$handlers ) as $handler ) { |
| 21 | $page = $handler->handle( $request ); |
| 22 | |
| 23 | if ( $page ) { |
| 24 | break; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return apply_filters( 'ac/admin/network/request/page', $page, $request ); |
| 29 | } |
| 30 | |
| 31 | } |