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.
46 lines
967 B
46 lines
967 B
<?php
|
|
|
|
namespace WCML\Options;
|
|
|
|
use WPML\Settings\PostType\Automatic;
|
|
use WPML\Setup\Option;
|
|
|
|
class WPML {
|
|
|
|
/** @return bool */
|
|
public static function shouldTranslateEverything() {
|
|
return method_exists( Option::class, 'shouldTranslateEverything' )
|
|
&& Option::shouldTranslateEverything();
|
|
}
|
|
|
|
/**
|
|
* @param string $postType
|
|
* @param bool $state
|
|
*/
|
|
public static function setAutomatic( $postType, $state ) {
|
|
if ( method_exists( Automatic::class, 'set' ) ) {
|
|
Automatic::set( $postType, $state );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param string $postType
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function isAutomatic( $postType ) {
|
|
if ( method_exists( Automatic::class, 'isAutomatic' ) ) {
|
|
return Automatic::isAutomatic( $postType );
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public static function useAte() {
|
|
return method_exists( \WPML_TM_ATE_Status::class, 'is_enabled_and_activated' )
|
|
&& \WPML_TM_ATE_Status::is_enabled_and_activated();
|
|
}
|
|
}
|
|
|