first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace WPML\ST\SlugTranslation\Hooks;
use WPML_Rewrite_Rule_Filter_Factory;
use WPML_ST_Slug_Translation_Settings_Factory;
class HooksFactory {
/**
* We need a static property because there could be many instances of HooksFactory class but we need to guarantee
* there is only a single instance of Hooks
*
* @var Hooks
*/
private static $instance;
/**
* @return Hooks
*/
public function create() {
if ( ! self::$instance ) {
$settings_factory = new WPML_ST_Slug_Translation_Settings_Factory();
$global_settings = $settings_factory->create();
self::$instance = new Hooks( new WPML_Rewrite_Rule_Filter_Factory(), $global_settings );
}
return self::$instance;
}
}