Body_Classes.php
2 weeks ago
Crons.php
2 weeks ago
Debug_Bar.php
2 weeks ago
Dialog.php
2 weeks ago
PUE.php
2 weeks ago
Processes.php
2 weeks ago
Promoter.php
2 weeks ago
Shortcodes.php
2 weeks ago
Tooltip.php
2 weeks ago
Widgets.php
2 weeks ago
Debug_Bar.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Hooks and manages the plugins Debug Bar integrations. |
| 5 | * |
| 6 | * @since 4.9.5 |
| 7 | */ |
| 8 | |
| 9 | class Tribe__Service_Providers__Debug_Bar extends tad_DI52_ServiceProvider { |
| 10 | |
| 11 | /** |
| 12 | * Binds and sets up implementations. |
| 13 | */ |
| 14 | public function register() { |
| 15 | add_filter( 'debug_bar_panels', [ $this, 'add_panels' ] ); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Adds The Events Calendar panels to the Debug Bar panels. |
| 20 | * |
| 21 | * @since 4.9.5 |
| 22 | * |
| 23 | * @param Debug_Bar_Panel[] $panels The current list of Debug Bar panels. |
| 24 | * |
| 25 | * @return array A modified list of Debug Bar panels. |
| 26 | */ |
| 27 | public function add_panels( array $panels ) { |
| 28 | /** |
| 29 | * Filters the list of The Events Calendar debug bar panels that will be added to the |
| 30 | * Debug Bar. |
| 31 | * |
| 32 | * @since 4.9.5 |
| 33 | * |
| 34 | * @param Debug_Bar_Panel[] The default list of The Events Calendar panels added to the Debug Bar. |
| 35 | */ |
| 36 | $tribe_panels = apply_filters( 'tribe_debug_bar_panels', [ |
| 37 | new Tribe__Debug_Bar__Panels__Context(), |
| 38 | new Tribe__Debug_Bar__Panels__Json_Ld(), |
| 39 | ] ); |
| 40 | |
| 41 | if ( count( $tribe_panels ) > 0 ) { |
| 42 | $panels = array_merge( $panels, $tribe_panels ); |
| 43 | } |
| 44 | |
| 45 | return $panels; |
| 46 | } |
| 47 | } |
| 48 |