tp TouchPointWP Utilities Translation - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\Utilities\Translation

Used for Translation management.


  • Full name: \tp\TouchPointWP\Utilities\Translation
  • This class is an Abstract class

Methods

useCampusAsLanguage

Determine whether campuses should be used as a "language" field.

public static useCampusAsLanguage(): bool
  • This method is static.

getWpmlLangCodeForString

Take a string and return the language code that it matches. Null if no match or WPML isn't enabled.

public static getWpmlLangCodeForString(string $string): string|null
  • This method is static. Parameters:
Parameter Type Description
$string string

setPostLanguageFromCampus

public static setPostLanguageFromCampus(?string $campusName, \WP_Post $post, string $postType, bool $verbose = false, bool $applyChanges = true): void
  • This method is static. Parameters:
Parameter Type Description
$campusName ?string
$post \WP_Post
$postType string
$verbose bool
$applyChanges bool