Home / APIs / _load_textdomain_just_in_time() – Loads plugin and theme textdomains just-in-time.

You appear to be a bot. Output may be restricted

Description

Loads plugin and theme textdomains just-in-time.

When a textdomain is encountered for the first time, we try to load the translation file from `wp-content/languages`, removing the need to call load_plugin_texdomain() or load_theme_texdomain().

Usage

$bool = _load_textdomain_just_in_time( $domain );

Parameters

$domain
( string ) required – Text domain. Unique identifier for retrieving translated strings.

Returns

bool True when the textdomain is successfully loaded, false otherwise.

Source

File name: wordpress/wp-includes/l10n.php
Lines: 1 to 17 of 17

function _load_textdomain_just_in_time( $domain ) {
  global $l10n_unloaded;

  $l10n_unloaded = (array) $l10n_unloaded;

  // Short-circuit if domain is 'default' which is reserved for core.
  if ( 'default' === $domain || isset( $l10n_unloaded[ $domain ] ) ) {
    return false;
  }

  $translation_path = _get_path_to_translation( $domain );
  if ( false === $translation_path ) {
    return false;
  }

  return load_textdomain( $domain, $translation_path );
}
 

 View on GitHub View on Trac

Published: 29th June 2017 | Last updated: 4th August 2017

Information

Function name: _load_textdomain_just_in_time
Plugin ref: WordPress
Version: 5.0.3
Sourcefile: wp-includes/l10n.php
File ref: wp-includes/l10n.php
API type: private
Deprecated?: No
API Letters: _,I,J,L,T

  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Files
  • Hooks
  • Classes
  • Sites
  • Sitemap
  • Blog
WooCommerce a2z WooCommerce a2z
WooCommerce

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2019. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins