| 1 |
<?php |
| 2 |
namespace epiphyt\Embed_Privacy\integration; |
| 3 |
|
| 4 |
use epiphyt\Embed_Privacy\System; |
| 5 |
|
| 6 |
/** |
| 7 |
* Shortcodes Ultimate integration for Embed Privacy. |
| 8 |
* |
| 9 |
* @author Epiphyt |
| 10 |
* @license GPL2 |
| 11 |
* @package epiphyt\Embed_Privacy |
| 12 |
* @since 1.10.0 |
| 13 |
*/ |
| 14 |
final class Shortcodes_Ultimate { |
| 15 |
/** |
| 16 |
* Initialize functionality. |
| 17 |
*/ |
| 18 |
public static function init() { |
| 19 |
\add_action( 'embed_privacy_print_assets', [ self::class, 'enqueue_assets' ] ); |
| 20 |
\add_action( 'embed_privacy_register_assets', [ self::class, 'register_assets' ], 10, 2 ); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Enqueue assets. |
| 25 |
*/ |
| 26 |
public static function enqueue_assets() { |
| 27 |
if ( System::is_plugin_active( 'shortcodes-ultimate/shortcodes-ultimate.php' ) ) { |
| 28 |
\wp_enqueue_style( 'embed-privacy-shortcodes-ultimate' ); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Register assets. |
| 34 |
* |
| 35 |
* @param bool $is_debug Whether debug mode is enabled |
| 36 |
* @param string $suffix A filename suffix |
| 37 |
*/ |
| 38 |
public static function register_assets( $is_debug, $suffix ) { |
| 39 |
if ( \file_exists( \EPI_EMBED_PRIVACY_BASE . 'assets/style/shortcodes-ultimate' . $suffix . '.css' ) ) { |
| 40 |
$css_file_url = \EPI_EMBED_PRIVACY_URL . 'assets/style/shortcodes-ultimate' . $suffix . '.css'; |
| 41 |
$file_version = $is_debug ? \filemtime( \EPI_EMBED_PRIVACY_BASE . 'assets/style/shortcodes-ultimate' . $suffix . '.css' ) : \EMBED_PRIVACY_VERSION; |
| 42 |
|
| 43 |
\wp_register_style( 'embed-privacy-shortcodes-ultimate', $css_file_url, [], $file_version ); |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
|