This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Para textos que pueden estar en singular o plural: _n( $singular, $plural, $numero, $dominio_de_traduccion ) | |
* printf() permite intercalar la variable con el número en el mensaje a traducir | |
*/ | |
printf( _n( 'Hay %d usuario activo.', 'Hay %d usuarios activos.', $count, 'dominio_de_traduccion' ), $count ); | |
/** | |
* Desambiguación por contexto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Acceder al directorio donde vamos a obtener el repositorio | |
cd /var/www | |
# Copiar los contenidos del repositorio al directorio i18n | |
svn checkout http://svn.automattic.com/wordpress-i18n/tools/trunk/ i18n/ | |
# Acceder al directorio donde están los archivos que queremos traducir | |
cd /var/www/proyecto/htdocs/wp-content/plugins/mi-plugin | |
# Crear la carpeta donde se van a almacenar las traducciones |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# instalar las herramientas de traducción de GNU. | |
# en Ubuntu están en el paquete gettext, en otras distribuciones puede tener otro nombre | |
sudo apt-get install gettext | |
# acceder a la carpeta donde están los archivos del proyecto | |
cd /var/www/proyecto/htdocs/wp-content/plugins/mi-plugin/ | |
# actualizar la plantilla de traducciones | |
php /var/www/i18n/makepot.php wp-plugin . l10n/dominio_de_traduccion.pot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$row = 1; | |
$per_loop = 0; | |
$loop = 1; | |
$headers = array(); | |
$files = array(); | |
if (($handle = fopen("datos.csv", "r")) !== FALSE){ | |
while (($data = fgetcsv($handle, 0, ";")) !== FALSE) { | |
if ( $row === 1 ) $headers = $data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Z-Index</title> | |
<style> | |
body{ | |
font-family: sans-serif; | |
} | |
figure, img{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Most Commented</title> | |
<link rel="stylesheet" href="https://raw.github.com/necolas/normalize.css/master/normalize.css" type="text/css"> | |
<style type="text/css"> | |
/* Sus estilos */ | |
body{ | |
background: #141414; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cf:before, | |
.cf:after { | |
content: " "; /* 1 */ | |
display: table; /* 2 */ | |
} | |
.cf:after { | |
clear: both; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set or explore post term associations | |
* | |
* @author Felipe Lavín Z. <[email protected]> | |
*/ | |
class Post_Term extends \WP_CLI_Command{ | |
/** | |
* Add a term to a post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$timezone = new DateTimeZone('America/Santiago'); | |
$now = new DateTimeImmutable('now', $timezone ); | |
$dds = $now->format('N'); | |
switch ( $dds ){ | |
// sabado | |
case 6: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// indicar los namespace que se utilizarán | |
use Elastica; | |
use Elastica\Query; | |
use Elastica\Exception; | |
$results = null; | |
try { |