HEX
Server: LiteSpeed
System: Linux server484.bertina.biz 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: alvnails (1268)
PHP: 8.2.29
Disabled: mail
Upload Files
File: /home/alvnails/public_html/wp-content/plugins/multisite-language-switcher/includes/MslsBlock.php
<?php declare( strict_types=1 );

namespace lloc\Msls;

class MslsBlock {

	protected MslsOptions $options;

	public function __construct( MslsOptions $options ) {
		$this->options = $options;
	}

	/**
	 * @codeCoverageIgnore
	 */
	public static function init(): void {
		$obj = new self( msls_options() );

		if ( function_exists( 'register_block_type' ) ) {
			$obj->register_block();
		}
	}

	/**
	 * Register block and shortcode.
	 */
	public function register_block(): bool {
		if ( $this->options->is_excluded() ) {
			return false;
		}

		register_block_type( MslsPlugin::plugin_dir_path( 'js/msls-widget-block' ) );

		return true;
	}
}