Function __global->get_lang

Definitions

sources/lang.php

  • Get the current language.First it tries to get the GET or POST language values, then it tries the user's language, then site default, then it resorts to EN.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id ?MEMBER No No required parameter N/A N/A The member ID (null: site default language, although better just to call get_site_default_lang directly)

Returns

  • The current language
  • Type: LANGUAGE_NAME
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the current language.First it tries to get the GET or POST language values, then it tries the user's language, then site default, then it resorts to EN.
 *
 * @param  ?MEMBER $member_id The member ID (null: site default language, although better just to call get_site_default_lang directly)
 * @return LANGUAGE_NAME The current language
 */

function get_lang(?int $member_id) : string