Skip to content

Commit

Permalink
adding the seating group path
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Nov 8, 2024
1 parent f68cd64 commit a1afa6d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
47 changes: 47 additions & 0 deletions src/Tickets/Seating/AssetGroupPath.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* The Seating Asset Group Path controller.
*
* @since TBD
*
* @package TEC\Controller;
*/

namespace TEC\Tickets\Seating;

use TEC\Common\Contracts\Provider\Controller as Controller_Contract;
use TEC\Common\StellarWP\Assets\Config;
use Tribe__Tickets__Main as Tickets_Plugin;

/**
* Class AssetGroupPath.
*
* @since TBD
*
* @package TEC\Controller;
*/
class AssetGroupPath extends Controller_Contract {

/**
* Unsubscribes from WordPress hooks.
*
* @since TBD
*
* @return void
*/
public function unregister(): void {
remove_action( 'tec_tickets_seating_tables_cron', [ Sessions::class, 'remove_expired_sessions' ] );
wp_clear_scheduled_hook( 'tec_tickets_seating_tables_cron' );
}

/**
* Registers the asset group path for seating
*
* @since 5.16.0
*
* @return void The asset group path is registered.
*/
protected function do_register(): void {
Config::add_group_path( 'tec-seating', Tickets_Plugin::instance()->plugin_path . 'build/', 'Seating/' );
}
}
3 changes: 2 additions & 1 deletion src/Tickets/Seating/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function is_active(): bool {
protected function do_register(): void {
require_once __DIR__ . '/template-tags.php';

$this->container->register( AssetGroupPath::class );
$this->container->singleton( Template::class );
$this->container->singleton( Localization::class );
$this->container->singleton( Session::class );
Expand Down Expand Up @@ -141,7 +142,7 @@ function () {
* AJAX will power both frontend and backend, always register it.
*/
$this->container->register( Admin\Ajax::class );

$this->container->register( Settings::class );

if ( is_admin() ) {
Expand Down

0 comments on commit a1afa6d

Please sign in to comment.