load_theme_textdomain example


function load_child_theme_textdomain( $domain$path = false ) {
    if ( ! $path ) {
        $path = get_stylesheet_directory();
    }
    return load_theme_textdomain( $domain$path );
}

/** * Loads the script translated strings. * * @since 5.0.0 * @since 5.0.2 Uses load_script_translations() to load translation data. * @since 5.1.0 The `$domain` parameter was made optional. * * @see WP_Scripts::set_translations() * * @param string $handle Name of the script to register a translation domain to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. * @return string|false The translated strings in JSON encoding on success, * false if the script textdomain could not be loaded. */
return true;
        }

        $path       = $this->get_stylesheet_directory();
        $domainpath = $this->get( 'DomainPath' );
        if ( $domainpath ) {
            $path .= $domainpath;
        } else {
            $path .= '/languages';
        }

        $this->textdomain_loaded = load_theme_textdomain( $textdomain$path );
        return $this->textdomain_loaded;
    }

    /** * Determines whether the theme is allowed (multisite only). * * @since 3.4.0 * * @param string $check Optional. Whether to check only the 'network'-wide settings, the 'site' * settings, or 'both'. Defaults to 'both'. * @param int $blog_id Optional. Ignored if only network-wide settings are checked. Defaults to current site. * @return bool Whether the theme is allowed for the network. Returns true in single-site. */
Home | Imprint | This part of the site doesn't use cookies.