-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from lightspeedwp/1.2.0/events-stylesheets
1.2.0 - TEC Block Specific Stylesheets
- Loading branch information
Showing
6 changed files
with
142 additions
and
58 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
* The block styles file | ||
* | ||
* @package lsx-design | ||
*/ | ||
|
||
namespace LSXD\Classes\Vendors; | ||
|
||
/** | ||
* All the functions that run on the frontend and the rendering of the blocks. | ||
* | ||
* @package LSX | ||
* @author LightSpeed | ||
* @license GPL3 | ||
* @link | ||
* @copyright 2023 LightSpeed | ||
*/ | ||
class TEC { | ||
|
||
/** | ||
* Handles the conditional loading of the WooCommerce files. | ||
* | ||
* @var array | ||
*/ | ||
private $assets = array(); | ||
|
||
/** | ||
* Contructor | ||
*/ | ||
public function __construct() { | ||
add_action( 'init', array( $this, 'enqueue_block_styles' ), 10 ); | ||
} | ||
|
||
/** | ||
* Returns an array of the block assets. | ||
* | ||
* @return array | ||
*/ | ||
private function get_assets() { | ||
$this->assets = array( | ||
'tec/archive-events' => array( | ||
'handle' => 'lsxd-tec-archive-events', | ||
'src' => get_template_directory_uri() . '/assets/css/tec/archive-events.css', | ||
'path' => get_template_directory() . '/assets/css/tec/archive-events.css', | ||
), | ||
'tribe/archive-events' => array( | ||
'handle' => 'lsxd-tec-archive-events', | ||
'src' => get_template_directory_uri() . '/assets/css/tec/archive-events.css', | ||
'path' => get_template_directory() . '/assets/css/tec/archive-events.css', | ||
), | ||
); | ||
return $this->assets; | ||
} | ||
|
||
/** | ||
* Registers our block specific styles. | ||
* | ||
* @return void | ||
*/ | ||
public function enqueue_block_styles() { | ||
foreach ( $this->get_assets() as $name => $asset ) { | ||
wp_enqueue_block_style( | ||
$name, | ||
array( | ||
'handle' => $asset['handle'], | ||
'src' => $asset['src'], | ||
'path' => $asset['path'], | ||
), | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* The core file | ||
* | ||
* @package lsx-design | ||
*/ | ||
|
||
namespace LSXD\Classes\Vendors; | ||
|
||
/** | ||
* The main file loading file for the Vendors related functionality. | ||
* | ||
* @package LSX | ||
* @author LightSpeed | ||
* @license GPL3 | ||
* @link | ||
* @copyright 2023 LightSpeed | ||
*/ | ||
class Vendors { | ||
|
||
/** | ||
* Hold the WooCommerce Object | ||
* | ||
* @var WooCommerce() | ||
*/ | ||
public $woocommerce; | ||
|
||
/** | ||
* Contructor | ||
*/ | ||
public function __construct() { | ||
add_action( 'init', array( $this, 'init' ), 1 ); | ||
} | ||
|
||
/** | ||
* Loads the actions we need. | ||
* | ||
* @return void | ||
*/ | ||
public function init() { | ||
if ( function_exists( 'WC' ) ) { | ||
$this->load_woocommerce(); | ||
} | ||
if ( class_exists( 'Tribe__Events__Main' ) ) { | ||
$this->load_tec(); | ||
} | ||
} | ||
|
||
/** | ||
* Load WooCommerce | ||
*/ | ||
public function load_woocommerce() { | ||
require get_template_directory() . '/includes/classes/vendors/class-woocommerce.php'; | ||
$this->woocommerce = new WooCommerce(); | ||
} | ||
|
||
/** | ||
* Loads The Events Calendar | ||
*/ | ||
public function load_tec() { | ||
require get_template_directory() . '/includes/classes/vendors/class-tec.php'; | ||
$this->woocommerce = new WooCommerce(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.