You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
541 B

<?php
namespace WCML\DisplayAsTranslated;
use function WPML\Container\make;
class FrontendHooksFactory implements \IWPML_Frontend_Action_Loader {
public function create() {
/** @var \SitePress $sitepress */
global $sitepress;
$hooks = [];
$isSecondaryLang = $sitepress->get_current_language() !== $sitepress->get_default_language();
if ( $isSecondaryLang ) {
if ( $sitepress->is_display_as_translated_taxonomy( 'product_cat' ) ) {
$hooks[] = make( ProductCatHooks::class );
}
}
return $hooks;
}
}