3 class WPML_Slug_Translation_Factory implements IWPML_Frontend_Action_Loader, IWPML_Backend_Action_Loader, IWPML_AJAX_Action_Loader {
6 const TAX = 'taxonomy';
8 const INIT_PRIORITY = -1000;
10 public function create() {
15 $records_factory = new WPML_Slug_Translation_Records_Factory();
16 $settings_factory = new WPML_ST_Slug_Translation_Settings_Factory();
18 $post_records = $records_factory->create( self::POST );
19 $tax_records = $records_factory->create( self::TAX );
21 $global_settings = $settings_factory->create();
22 $post_settings = $settings_factory->create( self::POST );
23 $tax_settings = $settings_factory->create( self::TAX );
25 $term_link_filter = new WPML_ST_Term_Link_Filter( $tax_records, $sitepress, new WPML_WP_Cache_Factory() );
27 $hooks['legacy_class'] = new WPML_Slug_Translation(
30 WPML_Get_LS_Languages_Status::get_instance(),
35 $hooks['rewrite_rules'] = ( new \WPML\ST\SlugTranslation\Hooks\HooksFactory() )->create();
38 $hooks['ui_save_post'] = new WPML_ST_Slug_Translation_UI_Save(
42 new WPML_WP_Post_Type(),
43 WPML_ST_Slug_Translation_UI_Save::ACTION_HOOK_FOR_POST
45 $hooks['ui_save_tax'] = new WPML_ST_Slug_Translation_UI_Save(
49 new WPML_WP_Taxonomy(),
50 WPML_ST_Slug_Translation_UI_Save::ACTION_HOOK_FOR_TAX
53 if ( $global_settings->is_enabled() ) {
54 $hooks['sync_strings'] = new WPML_ST_Slug_Translation_Strings_Sync(
61 $hooks['public-api'] = new WPML_ST_Slug_Translation_API(