Documentación

Para desarrolladores

Funciones

pht_switcher( array $args = [] );        // prints the switcher
pht_get_switcher( array $args = [] );    // returns the switcher's HTML
pht_current_language();                  // current language prefix ('' in the source language)

$args argumentos: style (inline, stack, dropdown, select), flags (bool), show_label (bool), class (string).

Ejemplo:

<?php if ( 'en' === pht_current_language() ) : ?>
	<p>Free shipping to the UK.</p>
<?php endif; ?>

Shortcode

[pht_switcher show_label="no" class="my-class"]

Filtros

FiltroPara qué sirve
pht_translatable_attributesLista de atributos HTML traducibles por elemento (recibe la lista y el nombre del elemento)
pht_search_paramsParámetros de la URL tratados como un término de búsqueda (por defecto q, s, search, term, query)
pht_gettext_sourcesCarpetas de donde se leen los textos del tema y el plugin

Acciones

AcciónCuando se activa
pht_purge_urlsDespués de traducir; recibe las direcciones traducidas que se deben purgar de la caché
pht_purge_allDespués de una ejecución larga; pide que se vacíe toda la caché

Para conectar un sistema de caché que el plugin no conoce:

add_action( 'pht_purge_urls', function ( array $urls ) {
	foreach ( $urls as $url ) {
		my_cache_purge( $url );
	}
} );

Variables CSS del conmutador

Definido en .pht-switcher: --pht-bg, --pht-fg, --pht-hover, --pht-radius y el resto de la sección de Apariencia.

Constante

define( 'PHT_LICENSE_KEY', 'PHT-...' );

Publicar.
Leelo en
cada idioma.

30,000 caracteres, un sitio, sin tarjeta. La clave llega por correo electrónico después de la compra.