Web de Gure Ametsa Bi Lagun en WordPress para Dokploy
- Docker Compose (WordPress + MariaDB) listo para Dokploy, con instalación automática por etapas: idiomas, páginas, menús y plugins recomendados. - Web bilingüe castellano / euskera con Polylang. - Tema propio «gure-ametsa»: diseño inspirado en Beargrass Animal Rescue, personalizable desde Apariencia → Personalizar (paletas, tipografías, secciones de portada ordenables) y patrones de bloques propios. - Plugin mu «gure-ametsa-core»: animales en adopción con ficha y filtros, carrusel y formulario de contacto/adopción. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
191
wp-content/themes/gure-ametsa/inc/customizer.php
Normal file
191
wp-content/themes/gure-ametsa/inc/customizer.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Personalizador: colores, tipografías, cabecera, contacto, portada y pie.
|
||||
*
|
||||
* Todas las opciones se definen en ga_customizer_registry(). Los textos marcados
|
||||
* como 'i18n' se guardan dos veces: en castellano (clave) y en euskera (clave + '_eu').
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once __DIR__ . '/registry.php';
|
||||
|
||||
/** Color efectivo: el de la paleta elegida o, si es «Personalizada», el elegido a mano. */
|
||||
function ga_color( $key ) {
|
||||
$palette = ga_opt( 'colors', 'palette' );
|
||||
$palettes = ga_palettes();
|
||||
if ( isset( $palettes[ $palette ][ $key ] ) ) {
|
||||
return $palettes[ $palette ][ $key ];
|
||||
}
|
||||
return ga_opt( 'colors', $key );
|
||||
}
|
||||
|
||||
/** Clave del theme_mod para un campo (y un idioma). */
|
||||
function ga_mod_key( $section, $field, $lang = 'es' ) {
|
||||
return "ga_{$section}_{$field}" . ( 'eu' === $lang ? '_eu' : '' );
|
||||
}
|
||||
|
||||
/** Valor por defecto de un campo. */
|
||||
function ga_field_default( $field, $lang = 'es' ) {
|
||||
if ( ! empty( $field['i18n'] ) ) {
|
||||
return $field[ $lang ] ?? '';
|
||||
}
|
||||
return $field['default'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Valor de una opción. Los textos 'i18n' se devuelven en el idioma actual.
|
||||
*/
|
||||
function ga_opt( $section, $field ) {
|
||||
$registry = ga_customizer_registry();
|
||||
$def = $registry[ $section ]['fields'][ $field ] ?? null;
|
||||
if ( ! $def ) {
|
||||
return '';
|
||||
}
|
||||
$lang = ! empty( $def['i18n'] ) ? ga_lang() : 'es';
|
||||
$key = ga_mod_key( $section, $field, $lang );
|
||||
return get_theme_mod( $key, ga_field_default( $def, $lang ) );
|
||||
}
|
||||
|
||||
/** Imprime un texto del personalizador escapado. */
|
||||
function ga_opt_e( $section, $field ) {
|
||||
echo esc_html( ga_opt( $section, $field ) );
|
||||
}
|
||||
|
||||
/** Secciones de portada visibles, ordenadas. */
|
||||
function ga_home_sections() {
|
||||
$sections = array();
|
||||
foreach ( ga_customizer_registry() as $id => $section ) {
|
||||
if ( ! empty( $section['section'] ) && ga_opt( $id, 'show' ) ) {
|
||||
$sections[ $id ] = (int) ga_opt( $id, 'order' );
|
||||
}
|
||||
}
|
||||
asort( $sections );
|
||||
return array_keys( $sections );
|
||||
}
|
||||
|
||||
/* Los datos de contacto y redes del personalizador sustituyen a los predeterminados. */
|
||||
add_filter( 'ga_info', function ( $info ) {
|
||||
foreach ( array( 'direccion', 'maps', 'telefono', 'email', 'horario' ) as $key ) {
|
||||
$info[ $key ] = ga_opt( 'contact', $key );
|
||||
}
|
||||
foreach ( array( 'instagram', 'facebook', 'tiktok', 'youtube', 'whatsapp' ) as $key ) {
|
||||
$info[ $key ] = ga_opt( 'social', $key );
|
||||
}
|
||||
return $info;
|
||||
} );
|
||||
|
||||
/* ---------- Registro en el personalizador ---------- */
|
||||
add_action( 'customize_register', function ( WP_Customize_Manager $c ) {
|
||||
$c->add_panel( 'ga_design', array( 'title' => 'Diseño (Gure Ametsa)', 'priority' => 25 ) );
|
||||
$c->add_panel( 'ga_info', array( 'title' => 'Contacto y redes', 'priority' => 26 ) );
|
||||
$c->add_panel( 'ga_home', array(
|
||||
'title' => 'Portada',
|
||||
'priority' => 27,
|
||||
'description' => 'Muestra, oculta y reordena las secciones de la portada. Los textos se escriben en castellano y en euskera.',
|
||||
) );
|
||||
|
||||
$sanitizers = array(
|
||||
'text' => 'sanitize_text_field',
|
||||
'textarea' => 'sanitize_textarea_field',
|
||||
'url' => 'esc_url_raw',
|
||||
'email' => 'sanitize_email',
|
||||
'color' => 'sanitize_hex_color',
|
||||
'checkbox' => fn( $v ) => (bool) $v,
|
||||
'number' => 'absint',
|
||||
'range' => 'absint',
|
||||
'image' => 'absint',
|
||||
'video' => 'absint',
|
||||
);
|
||||
|
||||
foreach ( ga_customizer_registry() as $sid => $section ) {
|
||||
$section_id = "ga_section_$sid";
|
||||
$c->add_section( $section_id, array(
|
||||
'title' => $section['title'],
|
||||
'panel' => $section['panel'],
|
||||
'description' => $section['description'] ?? '',
|
||||
) );
|
||||
|
||||
foreach ( $section['fields'] as $fid => $field ) {
|
||||
$langs = ! empty( $field['i18n'] ) ? array( 'es', 'eu' ) : array( 'es' );
|
||||
foreach ( $langs as $lang ) {
|
||||
$key = ga_mod_key( $sid, $fid, $lang );
|
||||
$sanitize = $sanitizers[ $field['type'] ] ?? null;
|
||||
if ( 'select' === $field['type'] ) {
|
||||
$choices = $field['choices'];
|
||||
$default = $field['default'];
|
||||
$sanitize = fn( $v ) => array_key_exists( $v, $choices ) ? $v : $default;
|
||||
}
|
||||
$c->add_setting( $key, array(
|
||||
'default' => ga_field_default( $field, $lang ),
|
||||
'sanitize_callback' => $sanitize,
|
||||
) );
|
||||
|
||||
$label = $field['label'] . ( ! empty( $field['i18n'] ) ? ( 'eu' === $lang ? ' · EU' : ' · ES' ) : '' );
|
||||
$args = array(
|
||||
'label' => $label,
|
||||
'section' => $section_id,
|
||||
'description' => $field['description'] ?? '',
|
||||
'priority' => empty( $field['i18n'] ) ? 50 : ( 'eu' === $lang ? 200 : 100 ),
|
||||
);
|
||||
|
||||
switch ( $field['type'] ) {
|
||||
case 'color':
|
||||
$c->add_control( new WP_Customize_Color_Control( $c, $key, $args ) );
|
||||
break;
|
||||
case 'image':
|
||||
case 'video':
|
||||
$c->add_control( new WP_Customize_Media_Control( $c, $key, $args + array( 'mime_type' => $field['type'] ) ) );
|
||||
break;
|
||||
case 'range':
|
||||
case 'number':
|
||||
$args['type'] = $field['type'];
|
||||
$args['input_attrs'] = array_filter( array(
|
||||
'min' => $field['min'] ?? null,
|
||||
'max' => $field['max'] ?? null,
|
||||
'step' => $field['step'] ?? 1,
|
||||
), fn( $v ) => null !== $v );
|
||||
if ( 'range' === $field['type'] ) {
|
||||
$args['description'] = trim( $args['description'] . ' Por defecto: ' . $field['default'] . '.' );
|
||||
}
|
||||
$c->add_control( $key, $args );
|
||||
break;
|
||||
case 'select':
|
||||
$c->add_control( $key, $args + array( 'type' => 'select', 'choices' => $field['choices'] ) );
|
||||
break;
|
||||
default:
|
||||
$c->add_control( $key, $args + array( 'type' => $field['type'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Separador visual entre castellano y euskera.
|
||||
$has_i18n = (bool) array_filter( $section['fields'], fn( $f ) => ! empty( $f['i18n'] ) );
|
||||
if ( $has_i18n ) {
|
||||
foreach ( array( 'es' => array( 99, 'Castellano' ), 'eu' => array( 199, 'Euskara' ) ) as $lang => [ $priority, $title ] ) {
|
||||
$c->add_setting( "ga_sep_{$sid}_{$lang}", array( 'sanitize_callback' => '__return_empty_string' ) );
|
||||
$c->add_control( new GA_Customize_Heading_Control( $c, "ga_sep_{$sid}_{$lang}", array(
|
||||
'label' => $title,
|
||||
'section' => $section_id,
|
||||
'priority' => $priority,
|
||||
) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
add_action( 'customize_register', function () {
|
||||
if ( class_exists( 'GA_Customize_Heading_Control' ) ) {
|
||||
return;
|
||||
}
|
||||
/** Encabezado sin campo, para separar idiomas. */
|
||||
class GA_Customize_Heading_Control extends WP_Customize_Control {
|
||||
public $type = 'ga-heading';
|
||||
public function render_content() {
|
||||
printf(
|
||||
'<h3 style="margin:18px 0 4px;padding:6px 10px;background:#1e5b3e;color:#fff;border-radius:4px;font-size:13px;letter-spacing:.06em;text-transform:uppercase">%s</h3>',
|
||||
esc_html( $this->label )
|
||||
);
|
||||
}
|
||||
}
|
||||
}, 1 );
|
||||
105
wp-content/themes/gure-ametsa/inc/dynamic-css.php
Normal file
105
wp-content/themes/gure-ametsa/inc/dynamic-css.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* CSS generado a partir del personalizador: colores, tipografías, tamaños.
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/** Luminancia relativa (WCAG) de un color hexadecimal. */
|
||||
function ga_luminance( $hex ) {
|
||||
$hex = ltrim( (string) $hex, '#' );
|
||||
if ( 3 === strlen( $hex ) ) {
|
||||
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
|
||||
}
|
||||
if ( 6 !== strlen( $hex ) ) {
|
||||
return 1;
|
||||
}
|
||||
$channels = array_map( function ( $c ) {
|
||||
$c = hexdec( $c ) / 255;
|
||||
return $c <= 0.03928 ? $c / 12.92 : ( ( $c + 0.055 ) / 1.055 ) ** 2.4;
|
||||
}, str_split( $hex, 2 ) );
|
||||
return 0.2126 * $channels[0] + 0.7152 * $channels[1] + 0.0722 * $channels[2];
|
||||
}
|
||||
|
||||
/** Texto legible (blanco o el color de texto) sobre un fondo dado. */
|
||||
function ga_readable_on( $background ) {
|
||||
$ink = ga_color( 'text' );
|
||||
$lum = ga_luminance( $background );
|
||||
$contrast_white = 1.05 / ( $lum + 0.05 );
|
||||
$contrast_ink = ( $lum + 0.05 ) / ( ga_luminance( $ink ) + 0.05 );
|
||||
return $contrast_white >= $contrast_ink ? '#ffffff' : $ink;
|
||||
}
|
||||
|
||||
function ga_dynamic_css() {
|
||||
$fonts = ga_fonts();
|
||||
$heading = $fonts[ ga_opt( 'typography', 'heading_font' ) ] ?? $fonts['fraunces'];
|
||||
$body = $fonts[ ga_opt( 'typography', 'body_font' ) ] ?? $fonts['karla'];
|
||||
|
||||
$css = '';
|
||||
foreach ( array_unique( array_filter( array( $heading['file'] ?? '', $body['file'] ?? '' ) ) ) as $file ) {
|
||||
$font = current( wp_list_filter( $fonts, array( 'file' => $file ) ) );
|
||||
$css .= sprintf(
|
||||
'@font-face{font-family:"%s";src:url("%s") format("woff2");font-weight:100 900;font-style:normal;font-display:swap;}',
|
||||
$font['family'],
|
||||
esc_url( get_theme_file_uri( "assets/fonts/$file.woff2" ) )
|
||||
);
|
||||
}
|
||||
|
||||
$accent = ga_color( 'accent' );
|
||||
$primary = ga_color( 'primary' );
|
||||
$vars = array(
|
||||
'--ga-green' => $primary,
|
||||
'--ga-red' => $accent,
|
||||
'--ga-cream' => ga_color( 'background' ),
|
||||
'--ga-sand' => ga_color( 'surface' ),
|
||||
'--ga-ink' => ga_color( 'text' ),
|
||||
'--ga-on-red' => ga_readable_on( $accent ),
|
||||
'--ga-on-primary' => ga_readable_on( $primary ),
|
||||
'--ga-serif' => $heading['stack'],
|
||||
'--ga-sans' => $body['stack'],
|
||||
'--ga-heading-weight' => (int) ga_opt( 'typography', 'heading_weight' ),
|
||||
'--ga-radius' => (int) ga_opt( 'typography', 'radius' ) . 'px',
|
||||
'--ga-size' => (int) ga_opt( 'typography', 'base_size' ) . 'px',
|
||||
);
|
||||
$css .= ':root{';
|
||||
foreach ( $vars as $name => $value ) {
|
||||
if ( '' !== $value && null !== $value ) {
|
||||
$css .= $name . ':' . wp_strip_all_tags( (string) $value ) . ';';
|
||||
}
|
||||
}
|
||||
$css .= '}';
|
||||
|
||||
return $css;
|
||||
}
|
||||
|
||||
add_action( 'wp_enqueue_scripts', function () {
|
||||
wp_add_inline_style( 'gure-ametsa', ga_dynamic_css() );
|
||||
}, 20 );
|
||||
|
||||
/* El editor de bloques usa los mismos colores y tipografías. */
|
||||
add_filter( 'block_editor_settings_all', function ( $settings ) {
|
||||
$settings['styles'][] = array( 'css' => ga_dynamic_css() );
|
||||
return $settings;
|
||||
} );
|
||||
|
||||
/* Paleta del editor = colores del tema. */
|
||||
add_action( 'after_setup_theme', function () {
|
||||
add_theme_support( 'editor-color-palette', array(
|
||||
array( 'name' => 'Principal', 'slug' => 'ga-green', 'color' => ga_color( 'primary' ) ),
|
||||
array( 'name' => 'Acento', 'slug' => 'ga-red', 'color' => ga_color( 'accent' ) ),
|
||||
array( 'name' => 'Secciones', 'slug' => 'ga-sand', 'color' => ga_color( 'surface' ) ),
|
||||
array( 'name' => 'Texto', 'slug' => 'ga-ink', 'color' => ga_color( 'text' ) ),
|
||||
array( 'name' => 'Blanco', 'slug' => 'white', 'color' => '#ffffff' ),
|
||||
) );
|
||||
}, 20 );
|
||||
|
||||
/* Clases en <body> según opciones de cabecera. */
|
||||
add_filter( 'body_class', function ( $classes ) {
|
||||
if ( ga_opt( 'header', 'sticky' ) ) {
|
||||
$classes[] = 'ga-sticky-header';
|
||||
}
|
||||
if ( ga_opt( 'header', 'highlight_first' ) ) {
|
||||
$classes[] = 'ga-nav-highlight';
|
||||
}
|
||||
return $classes;
|
||||
} );
|
||||
302
wp-content/themes/gure-ametsa/inc/patterns.php
Normal file
302
wp-content/themes/gure-ametsa/inc/patterns.php
Normal file
@@ -0,0 +1,302 @@
|
||||
<?php
|
||||
/**
|
||||
* Patrones de bloques (secciones prediseñadas) y estilos de bloque propios.
|
||||
*
|
||||
* Cada patrón se registra en castellano y en euskera. En el editor aparecen en
|
||||
* Añadir bloque (+) → Patrones → «Gure Ametsa».
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/* ---------- Estilos de bloque (panel lateral «Estilos» del editor) ---------- */
|
||||
add_action( 'init', function () {
|
||||
$styles = array(
|
||||
'core/group' => array(
|
||||
'ga-arena' => 'Fondo arena',
|
||||
'ga-verde' => 'Fondo principal',
|
||||
'ga-tarjeta' => 'Tarjeta',
|
||||
'ga-aviso' => 'Aviso destacado',
|
||||
),
|
||||
'core/paragraph' => array(
|
||||
'ga-antetitulo' => 'Antetítulo',
|
||||
'ga-entradilla' => 'Entradilla',
|
||||
),
|
||||
'core/image' => array(
|
||||
'ga-redondeada' => 'Esquinas redondeadas',
|
||||
'ga-arco' => 'Arco',
|
||||
),
|
||||
'core/list' => array(
|
||||
'ga-check' => 'Con marcas ✓',
|
||||
'ga-pasos' => 'Pasos numerados',
|
||||
'ga-limpia' => 'Sin viñetas',
|
||||
),
|
||||
'core/quote' => array(
|
||||
'ga-testimonio' => 'Testimonio',
|
||||
),
|
||||
'core/columns' => array(
|
||||
'ga-tarjetas' => 'Columnas como tarjetas',
|
||||
),
|
||||
);
|
||||
foreach ( $styles as $block => $list ) {
|
||||
foreach ( $list as $name => $label ) {
|
||||
register_block_style( $block, array( 'name' => $name, 'label' => $label ) );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
/* ---------- Patrones ---------- */
|
||||
add_action( 'init', function () {
|
||||
register_block_pattern_category( 'gure-ametsa', array( 'label' => 'Gure Ametsa' ) );
|
||||
|
||||
foreach ( array( 'es', 'eu' ) as $lang ) {
|
||||
$t = fn( $es, $eu ) => 'eu' === $lang ? $eu : $es;
|
||||
$url = fn( $slug_es, $slug_eu ) => 'eu' === $lang ? "/eu/$slug_eu/" : "/$slug_es/";
|
||||
$sfx = 'eu' === $lang ? ' (euskara)' : '';
|
||||
|
||||
foreach ( ga_pattern_definitions( $t, $url ) as $slug => [ $title, $description, $content ] ) {
|
||||
register_block_pattern( "gure-ametsa/$slug-$lang", array(
|
||||
'title' => $title . $sfx,
|
||||
'description' => $description,
|
||||
'categories' => array( 'gure-ametsa' ),
|
||||
'content' => $content,
|
||||
) );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
/** Botón de bloque. */
|
||||
function ga_p_button( $text, $href, $outline = false ) {
|
||||
$attrs = $outline ? ' {"className":"is-style-outline"}' : '';
|
||||
$class = $outline ? ' is-style-outline' : '';
|
||||
return "<!-- wp:button$attrs -->\n<div class=\"wp-block-button$class\"><a class=\"wp-block-button__link wp-element-button\" href=\"" . esc_url( $href ) . "\">$text</a></div>\n<!-- /wp:button -->";
|
||||
}
|
||||
|
||||
function ga_p_buttons( array $buttons, $center = false ) {
|
||||
$attrs = $center ? ' {"layout":{"type":"flex","justifyContent":"center"}}' : '';
|
||||
return "<!-- wp:buttons$attrs -->\n<div class=\"wp-block-buttons\">" . implode( "\n\n", $buttons ) . "</div>\n<!-- /wp:buttons -->";
|
||||
}
|
||||
|
||||
function ga_p_heading( $text, $level = 2, $center = false, $anchor = '' ) {
|
||||
$attrs = array();
|
||||
if ( 2 !== $level ) {
|
||||
$attrs['level'] = $level;
|
||||
}
|
||||
if ( $center ) {
|
||||
$attrs['textAlign'] = 'center';
|
||||
}
|
||||
if ( $anchor ) {
|
||||
$attrs['anchor'] = $anchor;
|
||||
}
|
||||
$json = $attrs ? ' ' . wp_json_encode( $attrs ) : '';
|
||||
$class = 'wp-block-heading' . ( $center ? ' has-text-align-center' : '' );
|
||||
$id = $anchor ? ' id="' . esc_attr( $anchor ) . '"' : '';
|
||||
return "<!-- wp:heading$json -->\n<h$level class=\"$class\"$id>$text</h$level>\n<!-- /wp:heading -->";
|
||||
}
|
||||
|
||||
function ga_p_paragraph( $text, $style = '', $center = false ) {
|
||||
$attrs = array();
|
||||
if ( $center ) {
|
||||
$attrs['align'] = 'center';
|
||||
}
|
||||
if ( $style ) {
|
||||
$attrs['className'] = "is-style-$style";
|
||||
}
|
||||
$json = $attrs ? ' ' . wp_json_encode( $attrs ) : '';
|
||||
$classes = trim( ( $center ? 'has-text-align-center ' : '' ) . ( $style ? "is-style-$style" : '' ) );
|
||||
$class = $classes ? " class=\"$classes\"" : '';
|
||||
return "<!-- wp:paragraph$json -->\n<p$class>$text</p>\n<!-- /wp:paragraph -->";
|
||||
}
|
||||
|
||||
function ga_p_list( array $items, $style = '', $ordered = false ) {
|
||||
$attrs = array();
|
||||
if ( $ordered ) {
|
||||
$attrs['ordered'] = true;
|
||||
}
|
||||
if ( $style ) {
|
||||
$attrs['className'] = "is-style-$style";
|
||||
}
|
||||
$json = $attrs ? ' ' . wp_json_encode( $attrs ) : '';
|
||||
$tag = $ordered ? 'ol' : 'ul';
|
||||
$lis = array_map( fn( $i ) => "<!-- wp:list-item -->\n<li>$i</li>\n<!-- /wp:list-item -->", $items );
|
||||
$cls = 'wp-block-list' . ( $style ? " is-style-$style" : '' );
|
||||
return "<!-- wp:list$json -->\n<$tag class=\"$cls\">" . implode( "\n\n", $lis ) . "</$tag>\n<!-- /wp:list -->";
|
||||
}
|
||||
|
||||
function ga_p_group( $inner, $style = '', $full = false ) {
|
||||
$attrs = array();
|
||||
if ( $full ) {
|
||||
$attrs['align'] = 'full';
|
||||
}
|
||||
$classes = array_filter( array( $style ? "is-style-$style" : '', $full ? 'ga-pad' : '' ) );
|
||||
if ( $classes ) {
|
||||
$attrs['className'] = implode( ' ', $classes );
|
||||
}
|
||||
$attrs['layout'] = array( 'type' => 'constrained' );
|
||||
$html_classes = implode( ' ', array_filter( array( 'wp-block-group', $full ? 'alignfull' : '', ...$classes ) ) );
|
||||
return '<!-- wp:group ' . wp_json_encode( $attrs ) . " -->\n<div class=\"$html_classes\">$inner</div>\n<!-- /wp:group -->";
|
||||
}
|
||||
|
||||
function ga_p_columns( array $columns, $style = '', $wide = true ) {
|
||||
$attrs = array();
|
||||
if ( $wide ) {
|
||||
$attrs['align'] = 'wide';
|
||||
}
|
||||
if ( $style ) {
|
||||
$attrs['className'] = "is-style-$style";
|
||||
}
|
||||
$json = $attrs ? ' ' . wp_json_encode( $attrs ) : '';
|
||||
$class = trim( 'wp-block-columns' . ( $wide ? ' alignwide' : '' ) . ( $style ? " is-style-$style" : '' ) );
|
||||
$cols = array_map( fn( $c ) => "<!-- wp:column -->\n<div class=\"wp-block-column\">$c</div>\n<!-- /wp:column -->", $columns );
|
||||
return "<!-- wp:columns$json -->\n<div class=\"$class\">" . implode( "\n\n", $cols ) . "</div>\n<!-- /wp:columns -->";
|
||||
}
|
||||
|
||||
function ga_p_shortcode( $code ) {
|
||||
return "<!-- wp:shortcode -->\n$code\n<!-- /wp:shortcode -->";
|
||||
}
|
||||
|
||||
/**
|
||||
* Definición de patrones: slug => [título, descripción, contenido].
|
||||
*
|
||||
* @param callable $t Traductor fn( $es, $eu ).
|
||||
* @param callable $url URL de página fn( $slug_es, $slug_eu ).
|
||||
*/
|
||||
function ga_pattern_definitions( $t, $url ) {
|
||||
$adopta = $url( 'adopta', 'adopta' );
|
||||
$contacto = $url( 'contacto', 'harremanetarako' ) . '#formulario';
|
||||
$colabora = $url( 'colabora', 'lagundu' );
|
||||
|
||||
return array(
|
||||
'portada' => array(
|
||||
$t( 'Portada con imagen', 'Azala irudiarekin' ),
|
||||
'Bloque de bienvenida a ancho completo con título, texto, botones e imagen.',
|
||||
ga_p_group(
|
||||
ga_p_columns( array(
|
||||
ga_p_paragraph( $t( 'Protectora · Hondarribia', 'Babeslekua · Hondarribia' ), 'ga-antetitulo' )
|
||||
. "\n\n" . ga_p_heading( $t( 'Adopta y cambia dos mundos', 'Adoptatu eta bi mundu aldatu' ) )
|
||||
. "\n\n" . ga_p_paragraph( $t( 'Rescatamos, cuidamos y buscamos una segunda oportunidad para perros y gatos abandonados.', 'Abandonatutako txakur eta katuak erreskatatu, zaindu eta bigarren aukera bat bilatzen diegu.' ), 'ga-entradilla' )
|
||||
. "\n\n" . ga_p_buttons( array(
|
||||
ga_p_button( $t( 'Conoce a los animales', 'Ezagutu animaliak' ), $adopta ),
|
||||
ga_p_button( $t( 'Quiero ayudar', 'Lagundu nahi dut' ), $colabora, true ),
|
||||
) ),
|
||||
"<!-- wp:image {\"sizeSlug\":\"large\",\"className\":\"is-style-ga-arco\"} -->\n<figure class=\"wp-block-image size-large is-style-ga-arco\"><img alt=\"\"/></figure>\n<!-- /wp:image -->",
|
||||
) ),
|
||||
'ga-arena',
|
||||
true
|
||||
),
|
||||
),
|
||||
'llamada' => array(
|
||||
$t( 'Llamada a la acción', 'Ekintzarako deia' ),
|
||||
'Franja de color con título, texto y botón centrados.',
|
||||
ga_p_group(
|
||||
ga_p_heading( $t( '¿Tienes sitio en casa… y en tu corazón?', 'Lekua duzu etxean… eta bihotzean?' ), 2, true )
|
||||
. "\n\n" . ga_p_paragraph( $t( 'Cada adopción deja una plaza libre para rescatar a otro animal.', 'Adopzio bakoitzak beste animalia bat erreskatatzeko lekua uzten du.' ), '', true )
|
||||
. "\n\n" . ga_p_buttons( array( ga_p_button( $t( 'Quiero adoptar', 'Adoptatu nahi dut' ), $contacto ) ), true ),
|
||||
'ga-verde',
|
||||
true
|
||||
),
|
||||
),
|
||||
'tarjetas' => array(
|
||||
$t( 'Tres tarjetas', 'Hiru txartel' ),
|
||||
'Tres columnas con icono, título y texto.',
|
||||
ga_p_columns( array(
|
||||
ga_p_paragraph( '🏡', 'ga-antetitulo' ) . "\n\n" . ga_p_heading( $t( 'Adopta', 'Adoptatu' ), 3 ) . "\n\n" . ga_p_paragraph( $t( 'Dale un hogar para siempre a un perro o un gato.', 'Eman betiko etxe bat txakur edo katu bati.' ) ),
|
||||
ga_p_paragraph( '🤝', 'ga-antetitulo' ) . "\n\n" . ga_p_heading( $t( 'Acoge', 'Harrera egin' ), 3 ) . "\n\n" . ga_p_paragraph( $t( 'Abre tu casa de forma temporal a quien más lo necesita.', 'Ireki zure etxea aldi baterako gehien behar duenari.' ) ),
|
||||
ga_p_paragraph( '💚', 'ga-antetitulo' ) . "\n\n" . ga_p_heading( $t( 'Dona', 'Egin dohaintza' ), 3 ) . "\n\n" . ga_p_paragraph( $t( 'Pienso, mantas o material veterinario.', 'Pentsua, mantak edo albaitaritza-materiala.' ) ),
|
||||
), 'ga-tarjetas' ),
|
||||
),
|
||||
'pasos' => array(
|
||||
$t( 'Pasos numerados', 'Urrats zenbakidunak' ),
|
||||
'Lista de pasos con números grandes.',
|
||||
ga_p_heading( $t( '¿Cómo adoptar?', 'Nola adoptatu?' ) )
|
||||
. "\n\n" . ga_p_list( array(
|
||||
$t( '<strong>Elige.</strong> Mira las fichas o ven a conocernos.', '<strong>Aukeratu.</strong> Begiratu fitxak edo etorri gu ezagutzera.' ),
|
||||
$t( '<strong>Escríbenos.</strong> Hablaremos sobre tu casa y tu rutina.', '<strong>Idatzi iezaguzu.</strong> Zure etxeaz eta ohiturez hitz egingo dugu.' ),
|
||||
$t( '<strong>Conócelo.</strong> Visitas y paseos sin prisas.', '<strong>Ezagutu.</strong> Bisitak eta ibilaldiak, presarik gabe.' ),
|
||||
$t( '<strong>¡A casa!</strong> Firmamos la adopción y seguimos a tu lado.', '<strong>Etxera!</strong> Adopzioa sinatu eta zure ondoan jarraituko dugu.' ),
|
||||
), 'ga-pasos', true ),
|
||||
),
|
||||
'animales' => array(
|
||||
$t( 'Animales en adopción', 'Adopzioko animaliak' ),
|
||||
'Rejilla automática con los últimos animales en adopción.',
|
||||
ga_p_heading( $t( 'Te están esperando', 'Zure zain daude' ) )
|
||||
. "\n\n" . ga_p_shortcode( '[ga_animales numero="4"]' )
|
||||
. "\n\n" . ga_p_buttons( array( ga_p_button( $t( 'Ver todos', 'Denak ikusi' ), $adopta ) ) ),
|
||||
),
|
||||
'carrusel' => array(
|
||||
$t( 'Carrusel de animales', 'Animalien karrusela' ),
|
||||
'Animales en adopción en un carrusel que se desliza.',
|
||||
ga_p_heading( $t( 'Te están esperando', 'Zure zain daude' ) )
|
||||
. "\n\n" . ga_p_shortcode( '[ga_animales numero="10" vista="carrusel"]' )
|
||||
. "\n\n" . ga_p_buttons( array( ga_p_button( $t( 'Ver todos', 'Denak ikusi' ), $adopta ) ) ),
|
||||
),
|
||||
'urgentes' => array(
|
||||
$t( 'Adopciones urgentes', 'Adopzio premiazkoak' ),
|
||||
'Rejilla automática solo con urgentes y animales que buscan acogida.',
|
||||
ga_p_group(
|
||||
ga_p_heading( $t( 'Nos necesitan ya', 'Orain behar gaituzte' ) )
|
||||
. "\n\n" . ga_p_paragraph( $t( 'Mayores, convalecientes o que llevan demasiado tiempo esperando.', 'Adinekoak, gaixorik daudenak edo denbora gehiegi daramatenak zain.' ) )
|
||||
. "\n\n" . ga_p_shortcode( '[ga_animales numero="3" estado="urgente,acogida"]' ),
|
||||
'ga-aviso'
|
||||
),
|
||||
),
|
||||
'imagen-texto' => array(
|
||||
$t( 'Imagen y texto', 'Irudia eta testua' ),
|
||||
'Imagen a un lado y texto al otro.',
|
||||
ga_p_columns( array(
|
||||
"<!-- wp:image {\"sizeSlug\":\"large\",\"className\":\"is-style-ga-redondeada\"} -->\n<figure class=\"wp-block-image size-large is-style-ga-redondeada\"><img alt=\"\"/></figure>\n<!-- /wp:image -->",
|
||||
ga_p_paragraph( $t( 'Nuestra historia', 'Gure historia' ), 'ga-antetitulo' )
|
||||
. "\n\n" . ga_p_heading( $t( 'Más de 25 años cuidando', '25 urte baino gehiago zaintzen' ) )
|
||||
. "\n\n" . ga_p_paragraph( $t( 'Escribe aquí vuestra historia, un rescate especial o cómo es el día a día en el refugio.', 'Idatzi hemen zuen historia, erreskate berezi bat edo babeslekuko eguneroko bizitza.' ) ),
|
||||
) ),
|
||||
),
|
||||
'testimonio' => array(
|
||||
$t( 'Testimonio de adopción', 'Adopzio-testigantza' ),
|
||||
'Cita destacada de una familia adoptante.',
|
||||
"<!-- wp:quote {\"className\":\"is-style-ga-testimonio\"} -->\n<blockquote class=\"wp-block-quote is-style-ga-testimonio\">"
|
||||
. ga_p_paragraph( $t( 'Llegó asustado y hoy es el rey del sofá. Adoptarle ha sido lo mejor que nos ha pasado.', 'Beldurtuta iritsi zen eta gaur sofako erregea da. Adoptatzea gertatu zaigun onena izan da.' ) )
|
||||
. '<cite>' . $t( 'Familia de Txuri, Irun', 'Txuriren familia, Irun' ) . "</cite></blockquote>\n<!-- /wp:quote -->",
|
||||
),
|
||||
'preguntas' => array(
|
||||
$t( 'Preguntas frecuentes', 'Ohiko galderak' ),
|
||||
'Preguntas desplegables.',
|
||||
ga_p_heading( $t( 'Preguntas frecuentes', 'Ohiko galderak' ) )
|
||||
. "\n\n" . implode( "\n\n", array_map(
|
||||
fn( $qa ) => "<!-- wp:details -->\n<details class=\"wp-block-details\"><summary>{$qa[0]}</summary>" . ga_p_paragraph( $qa[1] ) . "</details>\n<!-- /wp:details -->",
|
||||
array(
|
||||
array( $t( '¿Cuánto cuesta adoptar?', 'Zenbat balio du adoptatzeak?' ), $t( 'Escribe aquí la respuesta.', 'Idatzi hemen erantzuna.' ) ),
|
||||
array( $t( '¿Puedo adoptar si vivo en un piso?', 'Adopta dezaket pisu batean bizi banaiz?' ), $t( 'Escribe aquí la respuesta.', 'Idatzi hemen erantzuna.' ) ),
|
||||
array( $t( '¿Hacéis seguimiento después?', 'Jarraipena egiten duzue gero?' ), $t( 'Escribe aquí la respuesta.', 'Idatzi hemen erantzuna.' ) ),
|
||||
)
|
||||
) ),
|
||||
),
|
||||
'donaciones' => array(
|
||||
$t( 'Qué necesitamos', 'Zer behar dugu' ),
|
||||
'Tarjeta con lista de necesidades y botón.',
|
||||
ga_p_group(
|
||||
ga_p_heading( $t( 'Qué necesitamos ahora', 'Zer behar dugun orain' ), 3 )
|
||||
. "\n\n" . ga_p_list( array(
|
||||
$t( 'Pienso para cachorros', 'Kumeentzako pentsua' ),
|
||||
$t( 'Arena para gatos', 'Katuentzako harea' ),
|
||||
$t( 'Mantas y toallas', 'Mantak eta eskuoihalak' ),
|
||||
), 'ga-check' )
|
||||
. "\n\n" . ga_p_buttons( array( ga_p_button( $t( 'Quiero colaborar', 'Lagundu nahi dut' ), $contacto ) ) ),
|
||||
'ga-tarjeta'
|
||||
),
|
||||
),
|
||||
'contacto' => array(
|
||||
$t( 'Contacto con formulario', 'Harremana formularioarekin' ),
|
||||
'Datos de contacto y formulario en dos columnas.',
|
||||
ga_p_columns( array(
|
||||
ga_p_heading( $t( 'Ven a vernos', 'Etorri gu ikustera' ), 3 )
|
||||
. "\n\n" . ga_p_list( array(
|
||||
'📍 Jaizubia, 44 · 20280 Hondarribia',
|
||||
'📞 <a href="tel:+34943645279">943 64 52 79</a>',
|
||||
'✉️ <a href="mailto:hola@gureametsabilagun.org">hola@gureametsabilagun.org</a>',
|
||||
$t( '🕙 L–V: 10:00–13:00 y 14:00–19:00', '🕙 Al–Or: 10:00–13:00 eta 14:00–19:00' ),
|
||||
), 'ga-limpia' ),
|
||||
ga_p_heading( $t( 'Escríbenos', 'Idatzi iezaguzu' ), 3, false, 'formulario' )
|
||||
. "\n\n" . ga_p_shortcode( '[ga_contacto]' ),
|
||||
) ),
|
||||
),
|
||||
);
|
||||
}
|
||||
437
wp-content/themes/gure-ametsa/inc/registry.php
Normal file
437
wp-content/themes/gure-ametsa/inc/registry.php
Normal file
@@ -0,0 +1,437 @@
|
||||
<?php
|
||||
/**
|
||||
* Registro de opciones del tema (Apariencia → Personalizar).
|
||||
*
|
||||
* Cada sección: title, panel, fields. Cada campo: type (text, textarea, url, email, color,
|
||||
* checkbox, number, range, select, image, video), label, default (o es/eu si 'i18n' => true).
|
||||
* Las secciones con 'section' => true son bloques de la portada (se pueden ocultar y reordenar).
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/** Tipografías incluidas en el tema (assets/fonts) y de sistema. */
|
||||
function ga_fonts() {
|
||||
return array(
|
||||
'fraunces' => array( 'label' => 'Fraunces (serif, con carácter)', 'file' => 'fraunces', 'family' => 'Fraunces', 'stack' => 'Fraunces, Georgia, serif' ),
|
||||
'karla' => array( 'label' => 'Karla (sans, cercana)', 'file' => 'karla', 'family' => 'Karla', 'stack' => 'Karla, system-ui, sans-serif' ),
|
||||
'lora' => array( 'label' => 'Lora (serif, clásica)', 'file' => 'lora', 'family' => 'Lora', 'stack' => 'Lora, Georgia, serif' ),
|
||||
'playfair' => array( 'label' => 'Playfair Display (serif, elegante)', 'file' => 'playfair-display', 'family' => 'Playfair Display', 'stack' => '"Playfair Display", Georgia, serif' ),
|
||||
'nunito' => array( 'label' => 'Nunito (redondeada, amable)', 'file' => 'nunito', 'family' => 'Nunito', 'stack' => 'Nunito, system-ui, sans-serif' ),
|
||||
'inter' => array( 'label' => 'Inter (moderna, muy legible)', 'file' => 'inter', 'family' => 'Inter', 'stack' => 'Inter, system-ui, sans-serif' ),
|
||||
'opensans' => array( 'label' => 'Open Sans (neutra)', 'file' => 'open-sans', 'family' => 'Open Sans', 'stack' => '"Open Sans", system-ui, sans-serif' ),
|
||||
'system-serif' => array( 'label' => 'Serif del sistema', 'stack' => '"Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif' ),
|
||||
'system-sans' => array( 'label' => 'Sans del sistema', 'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' ),
|
||||
);
|
||||
}
|
||||
|
||||
/** Paletas rápidas. 'custom' usa los colores elegidos a mano. */
|
||||
function ga_palettes() {
|
||||
return array(
|
||||
'ciruela' => array(
|
||||
'label' => 'Ciruela y mostaza',
|
||||
'primary' => '#5b2c4e',
|
||||
'accent' => '#e8a317',
|
||||
'background' => '#fdf8f1',
|
||||
'surface' => '#f5ead9',
|
||||
'text' => '#241a21',
|
||||
),
|
||||
'verde' => array(
|
||||
'label' => 'Verde y rojo',
|
||||
'primary' => '#1e5b3e',
|
||||
'accent' => '#c23b2a',
|
||||
'background' => '#fffcf6',
|
||||
'surface' => '#f7f1e6',
|
||||
'text' => '#1d2721',
|
||||
),
|
||||
'mar' => array(
|
||||
'label' => 'Azul mar y coral',
|
||||
'primary' => '#1f4e6b',
|
||||
'accent' => '#f07b5a',
|
||||
'background' => '#fbfaf7',
|
||||
'surface' => '#eaf1f2',
|
||||
'text' => '#1b2a33',
|
||||
),
|
||||
'bosque' => array(
|
||||
'label' => 'Bosque y teja',
|
||||
'primary' => '#2f4a34',
|
||||
'accent' => '#d9822b',
|
||||
'background' => '#fbf8f2',
|
||||
'surface' => '#efe8da',
|
||||
'text' => '#20261f',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function ga_customizer_registry() {
|
||||
static $registry = null;
|
||||
if ( null !== $registry ) {
|
||||
return $registry;
|
||||
}
|
||||
|
||||
$t = fn( $label, $es, $eu, $type = 'text' ) => array( 'type' => $type, 'label' => $label, 'i18n' => true, 'es' => $es, 'eu' => $eu );
|
||||
|
||||
$step = function ( $n, $es_t, $es_d, $eu_t, $eu_d ) use ( $t ) {
|
||||
return array(
|
||||
"step{$n}_title" => $t( "Paso $n · título", $es_t, $eu_t ),
|
||||
"step{$n}_text" => $t( "Paso $n · texto", $es_d, $eu_d, 'textarea' ),
|
||||
);
|
||||
};
|
||||
$door = function ( $n, $kicker, $title, $text, $link ) use ( $t ) {
|
||||
return array(
|
||||
"door{$n}_kicker" => $t( "Puerta $n · etiqueta", $kicker[0], $kicker[1] ),
|
||||
"door{$n}_title" => $t( "Puerta $n · título", $title[0], $title[1] ),
|
||||
"door{$n}_text" => $t( "Puerta $n · texto", $text[0], $text[1] ),
|
||||
"door{$n}_link" => $t( "Puerta $n · enlace", $link[0], $link[1] ),
|
||||
);
|
||||
};
|
||||
$card = function ( $prefix, $n, $title, $text ) use ( $t ) {
|
||||
return array(
|
||||
"{$prefix}{$n}_title" => $t( ucfirst( $prefix ) . " $n · título (vacío = ocultar)", $title[0], $title[1] ),
|
||||
"{$prefix}{$n}_text" => $t( ucfirst( $prefix ) . " $n · texto", $text[0], $text[1], 'textarea' ),
|
||||
);
|
||||
};
|
||||
$qa = function ( $n, $es_q, $es_a, $eu_q, $eu_a ) use ( $t ) {
|
||||
return array(
|
||||
"q{$n}" => $t( "Pregunta $n (vacío = ocultar)", $es_q, $eu_q ),
|
||||
"a{$n}" => $t( "Respuesta $n", $es_a, $eu_a, 'textarea' ),
|
||||
);
|
||||
};
|
||||
|
||||
$palette_choices = array_map( fn( $p ) => $p['label'], ga_palettes() ) + array( 'custom' => 'Personalizada (colores de abajo)' );
|
||||
$default = ga_palettes()['ciruela'];
|
||||
|
||||
$registry = array(
|
||||
/* ================= Diseño ================= */
|
||||
'colors' => array(
|
||||
'panel' => 'ga_design',
|
||||
'title' => 'Colores',
|
||||
'fields' => array(
|
||||
'palette' => array( 'type' => 'select', 'label' => 'Paleta', 'default' => 'ciruela', 'choices' => $palette_choices, 'description' => 'Elige una paleta lista, o «Personalizada» para usar los colores de abajo.' ),
|
||||
'primary' => array( 'type' => 'color', 'label' => 'Color principal', 'default' => $default['primary'], 'description' => 'Títulos, botones de la cabecera, secciones oscuras y pie.' ),
|
||||
'accent' => array( 'type' => 'color', 'label' => 'Color de acento', 'default' => $default['accent'], 'description' => 'Botones principales, detalles y palabras resaltadas.' ),
|
||||
'background' => array( 'type' => 'color', 'label' => 'Fondo de la página', 'default' => $default['background'] ),
|
||||
'surface' => array( 'type' => 'color', 'label' => 'Fondo de secciones alternas', 'default' => $default['surface'] ),
|
||||
'text' => array( 'type' => 'color', 'label' => 'Color del texto', 'default' => $default['text'] ),
|
||||
),
|
||||
),
|
||||
'typography' => array(
|
||||
'panel' => 'ga_design',
|
||||
'title' => 'Tipografía',
|
||||
'fields' => array(
|
||||
'heading_font' => array( 'type' => 'select', 'label' => 'Tipografía de títulos', 'default' => 'fraunces', 'choices' => wp_list_pluck( ga_fonts(), 'label' ) ),
|
||||
'heading_weight' => array( 'type' => 'select', 'label' => 'Grosor de los títulos', 'default' => '800', 'choices' => array(
|
||||
'500' => 'Normal',
|
||||
'600' => 'Seminegrita',
|
||||
'700' => 'Negrita',
|
||||
'800' => 'Extra negrita',
|
||||
'900' => 'Máximo',
|
||||
) ),
|
||||
'body_font' => array( 'type' => 'select', 'label' => 'Tipografía del texto', 'default' => 'karla', 'choices' => wp_list_pluck( ga_fonts(), 'label' ) ),
|
||||
'base_size' => array( 'type' => 'range', 'label' => 'Tamaño del texto (px)', 'default' => 17, 'min' => 15, 'max' => 20, 'step' => 1 ),
|
||||
'radius' => array( 'type' => 'range', 'label' => 'Redondeo de esquinas (px)', 'default' => 14, 'min' => 0, 'max' => 32, 'step' => 2 ),
|
||||
),
|
||||
),
|
||||
'header' => array(
|
||||
'panel' => 'ga_design',
|
||||
'title' => 'Cabecera',
|
||||
'fields' => array(
|
||||
'phone' => array( 'type' => 'checkbox', 'label' => 'Mostrar el teléfono en la cabecera', 'default' => true ),
|
||||
'switcher' => array( 'type' => 'checkbox', 'label' => 'Mostrar selector de idioma ES | EU', 'default' => true ),
|
||||
'sticky' => array( 'type' => 'checkbox', 'label' => 'Cabecera fija al hacer scroll', 'default' => true ),
|
||||
'topbar' => array( 'type' => 'checkbox', 'label' => 'Barra superior con horario y redes', 'default' => false ),
|
||||
'highlight_first' => array( 'type' => 'checkbox', 'label' => 'Resaltar el primer elemento del menú como botón', 'default' => false ),
|
||||
'brand_line1' => array( 'type' => 'text', 'label' => 'Nombre (si no hay logo) · línea 1', 'default' => 'Gure Ametsa' ),
|
||||
'brand_line2' => array( 'type' => 'text', 'label' => 'Nombre (si no hay logo) · línea 2', 'default' => 'Bi Lagun' ),
|
||||
'brand_line3' => array( 'type' => 'text', 'label' => 'Nombre (si no hay logo) · lugar', 'default' => 'Hondarribia' ),
|
||||
'cta1' => $t( 'Botón de cabecera (vacío = ocultar)', 'Conoce a los animales', 'Ezagutu animaliak' ),
|
||||
'cta1_url' => array( 'type' => 'text', 'label' => 'Botón · enlace (vacío = listado de adopción)', 'default' => '' ),
|
||||
'cta2' => $t( 'Segundo botón (vacío = ocultar)', '', '' ),
|
||||
'cta2_url' => array( 'type' => 'text', 'label' => 'Segundo botón · enlace (vacío = Colabora → Donaciones)', 'default' => '' ),
|
||||
),
|
||||
),
|
||||
'footer' => array(
|
||||
'panel' => 'ga_design',
|
||||
'title' => 'Pie de página',
|
||||
'fields' => array(
|
||||
'about' => $t( 'Texto de presentación',
|
||||
'Protectora y residencia de animales en Jaizubia, Hondarribia. Desde hace más de 25 años recogemos, cuidamos y buscamos hogar a los perros y gatos abandonados de Irun y Hondarribia.',
|
||||
'Animalien babesleku eta egoitza Jaizubian, Hondarribian. 25 urte baino gehiago daramatzagu Irun eta Hondarribiko txakur eta katu abandonatuak jasotzen, zaintzen eta etxe bat bilatzen.', 'textarea' ),
|
||||
'copyright' => array( 'type' => 'text', 'label' => 'Texto de copyright', 'default' => 'Gure Ametsa Bi Lagun' ),
|
||||
),
|
||||
),
|
||||
|
||||
/* ================= Contacto ================= */
|
||||
'contact' => array(
|
||||
'panel' => 'ga_info',
|
||||
'title' => 'Datos de contacto',
|
||||
'fields' => array(
|
||||
'direccion' => array( 'type' => 'text', 'label' => 'Dirección', 'default' => 'Jaizubia, 44 · 20280 Hondarribia (Gipuzkoa)' ),
|
||||
'maps' => array( 'type' => 'url', 'label' => 'Enlace a Google Maps', 'default' => 'https://www.google.com/maps/search/?api=1&query=Jaizubia+44+Hondarribia' ),
|
||||
'telefono' => array( 'type' => 'text', 'label' => 'Teléfono', 'default' => '943 64 52 79' ),
|
||||
'email' => array( 'type' => 'email', 'label' => 'Email', 'default' => 'hola@gureametsabilagun.org' ),
|
||||
'horario' => $t( 'Horario', 'Lunes a viernes: 10:00–13:00 y 14:00–19:00', 'Astelehenetik ostiralera: 10:00–13:00 eta 14:00–19:00' ),
|
||||
),
|
||||
),
|
||||
'social' => array(
|
||||
'panel' => 'ga_info',
|
||||
'title' => 'Redes sociales',
|
||||
'fields' => array(
|
||||
'instagram' => array( 'type' => 'url', 'label' => 'Instagram', 'default' => 'https://www.instagram.com/gureametsabilagun/' ),
|
||||
'facebook' => array( 'type' => 'url', 'label' => 'Facebook', 'default' => 'https://www.facebook.com/gureametsabilagun/' ),
|
||||
'tiktok' => array( 'type' => 'url', 'label' => 'TikTok', 'default' => '' ),
|
||||
'youtube' => array( 'type' => 'url', 'label' => 'YouTube', 'default' => '' ),
|
||||
'whatsapp' => array( 'type' => 'text', 'label' => 'WhatsApp (número con prefijo, p. ej. 34600111222)', 'default' => '' ),
|
||||
),
|
||||
),
|
||||
|
||||
/* ================= Portada ================= */
|
||||
'hero' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Portada principal y «puertas»',
|
||||
'section' => true,
|
||||
'fields' => array_merge(
|
||||
array(
|
||||
'layout' => array( 'type' => 'select', 'label' => 'Diseño', 'default' => 'full', 'choices' => array(
|
||||
'full' => 'Foto o vídeo a pantalla completa',
|
||||
'split' => 'Texto a la izquierda, foto a la derecha',
|
||||
) ),
|
||||
'image' => array( 'type' => 'image', 'label' => 'Foto', 'default' => 0 ),
|
||||
'video' => array( 'type' => 'video', 'label' => 'Vídeo de fondo (opcional, MP4 corto y sin sonido)', 'default' => 0, 'description' => 'Se reproduce en bucle. La foto se muestra mientras carga.' ),
|
||||
'overlay' => array( 'type' => 'range', 'label' => 'Velo de color sobre la foto (%)', 'default' => 70, 'min' => 0, 'max' => 95, 'step' => 5 ),
|
||||
'eyebrow' => $t( 'Etiqueta superior', 'Protectora de animales · Hondarribia', 'Animalien babeslekua · Hondarribia' ),
|
||||
'title' => $t( 'Título (pon *entre asteriscos* la parte resaltada)', 'Tu mejor amigo *te está esperando*', 'Zure lagunik onena *zure zain dago*' ),
|
||||
'lead' => $t( 'Texto',
|
||||
'La mayoría nos conoce porque quiere adoptar. Pero adoptar es solo una de las cuatro puertas: acoger, echar una mano y donar son las que mantienen la primera abierta. Elige la que encaja con tu vida ahora.',
|
||||
'Gehienek adoptatu nahi dutelako ezagutzen gaituzte. Baina adoptatzea lau ateetako bat baino ez da: harrera egitea, laguntzea eta dohaintzak egitea dira lehena irekita mantentzen dutenak. Aukeratu orain zure bizitzara hobekien egokitzen dena.', 'textarea' ),
|
||||
'btn1' => $t( 'Botón 1', 'Ver quién está disponible', 'Ikusi nor dagoen zain' ),
|
||||
'btn1_url' => array( 'type' => 'text', 'label' => 'Botón 1 · enlace (vacío = listado de adopción)', 'default' => '' ),
|
||||
'btn2' => $t( 'Botón 2', 'Planifica tu visita', 'Antolatu zure bisita' ),
|
||||
'btn2_url' => array( 'type' => 'text', 'label' => 'Botón 2 · enlace (vacío = página de contacto)', 'default' => '' ),
|
||||
'doors' => array( 'type' => 'checkbox', 'label' => 'Mostrar las cuatro «puertas» bajo la portada', 'default' => true ),
|
||||
),
|
||||
$door( 1, array( 'Adopta', 'Adoptatu' ), array( 'Conócelos', 'Ezagutu' ), array( 'Perros y gatos que buscan una familia para siempre.', 'Betiko familia bila dabiltzan txakur eta katuak.' ), array( 'Ver animales', 'Ikusi animaliak' ) ),
|
||||
$door( 2, array( 'Acoge', 'Harrera' ), array( 'Abre tu casa', 'Ireki etxea' ), array( 'Un hogar temporal mientras encuentran su familia.', 'Aldi baterako etxe bat, familia aurkitu bitartean.' ), array( 'Quiero acoger', 'Harrera egin nahi dut' ) ),
|
||||
$door( 3, array( 'Voluntariado', 'Boluntariotza' ), array( 'Echa una mano', 'Eman esku bat' ), array( 'Paseos, mimos, fotos y ayuda en jornadas.', 'Ibilaldiak, laztanak, argazkiak eta laguntza jardunaldietan.' ), array( 'Apúntate', 'Eman izena' ) ),
|
||||
$door( 4, array( 'Dona', 'Dohaintza' ), array( 'Colabora', 'Lagundu' ), array( 'Pienso, mantas, material o una aportación.', 'Pentsua, mantak, materiala edo ekarpen bat.' ), array( 'Cómo donar', 'Nola eman' ) )
|
||||
),
|
||||
),
|
||||
'animals' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Animales en adopción',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Puerta uno · Adopta', 'Lehen atea · Adoptatu' ),
|
||||
'title' => $t( 'Título', 'Te están esperando', 'Zure zain daude' ),
|
||||
'text' => $t( 'Texto', 'Todos se entregan con microchip, vacunas al día y esterilizados. Si alguno te roba el corazón, escríbenos y te contamos todo sobre él.', 'Guztiak mikrotxiparekin, txertoak egunean eta antzututa ematen dira. Norbaitek bihotza lapurtzen badizu, idatzi iezaguzu eta dena kontatuko dizugu.', 'textarea' ),
|
||||
'button' => $t( 'Botón', 'Ver todos los animales', 'Ikusi animalia guztiak' ),
|
||||
'count' => array( 'type' => 'number', 'label' => 'Número de animales', 'default' => 8, 'min' => 2, 'max' => 24 ),
|
||||
'view' => array( 'type' => 'select', 'label' => 'Presentación', 'default' => 'carrusel', 'choices' => array(
|
||||
'carrusel' => 'Carrusel (se desliza)',
|
||||
'rejilla' => 'Rejilla',
|
||||
) ),
|
||||
'filter' => array( 'type' => 'select', 'label' => 'Qué animales mostrar', 'default' => '', 'choices' => array(
|
||||
'' => 'Todos los disponibles',
|
||||
'urgente,acogida' => 'Solo urgentes y los que buscan acogida',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
'steps' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Cómo adoptar',
|
||||
'section' => true,
|
||||
'fields' => array_merge(
|
||||
array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Qué pasa después', 'Zer gertatzen da gero' ),
|
||||
'title' => $t( 'Título', 'Una adopción clara, paso a paso', 'Adopzio argia, urratsez urrats' ),
|
||||
'text' => $t( 'Texto', 'Queremos que la adopción salga bien para siempre. Por eso vamos sin prisas y te acompañamos en cada paso.', 'Adopzioak betirako ondo irtetea nahi dugu. Horregatik presarik gabe goaz eta urrats bakoitzean lagunduko dizugu.', 'textarea' ),
|
||||
),
|
||||
$step( 1, 'Escríbenos', 'Rellena el formulario o llámanos. Cuéntanos cómo es tu casa, tu día a día y qué animal buscas.',
|
||||
'Idatzi iezaguzu', 'Bete formularioa edo deitu iezaguzu. Kontaiguzu nolakoa den zure etxea, zure eguneroko bizitza eta zer animalia bilatzen duzun.' ),
|
||||
$step( 2, 'Hablamos', 'Te llamamos para conocerte y resolver dudas. Es una conversación, no un examen.',
|
||||
'Hitz egingo dugu', 'Deituko dizugu zu ezagutzeko eta zalantzak argitzeko. Elkarrizketa bat da, ez azterketa bat.' ),
|
||||
$step( 3, 'Os conocéis', 'Ven a Jaizubia a conocerle. Paseos y visitas sin prisas, con toda la familia.',
|
||||
'Elkar ezagutu', 'Etorri Jaizubira hura ezagutzera. Ibilaldiak eta bisitak presarik gabe, familia osoarekin.' ),
|
||||
$step( 4, '¡A casa!', 'Firmamos el contrato de adopción y seguimos a tu lado para lo que necesites.',
|
||||
'Etxera!', 'Adopzio-kontratua sinatuko dugu eta behar duzun guztirako zure ondoan jarraituko dugu.' ),
|
||||
array( 'button' => $t( 'Botón', 'Quiero adoptar', 'Adoptatu nahi dut' ) )
|
||||
),
|
||||
),
|
||||
'foster' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Acogida',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Puerta dos · Acoge', 'Bigarren atea · Harrera' ),
|
||||
'title' => $t( 'Título', 'Acoger es lo que nos permite decir que sí', 'Harrera egiteak baietz esateko aukera ematen digu' ),
|
||||
'text' => $t( 'Texto', 'Cachorros, animales mayores o convalecientes necesitan salir del centro cuanto antes. Una casa de acogida les da tiempo y cariño mientras encuentran su familia definitiva.', 'Kumeek, animalia zaharrek edo gaixorik daudenek lehenbailehen irten behar dute zentrotik. Harrera-etxe batek denbora eta maitasuna ematen die behin betiko familia aurkitu bitartean.', 'textarea' ),
|
||||
'list_title' => $t( 'Título de la lista', 'Contigo en todo momento', 'Zurekin uneoro' ),
|
||||
'list' => $t( 'Lista (una línea por punto)',
|
||||
"Te explicamos qué necesita cada animal antes de llevarlo a casa\nResolvemos tus dudas durante toda la acogida\nBuscamos juntos su familia definitiva",
|
||||
"Etxera eraman aurretik animalia bakoitzak zer behar duen azaltzen dizugu\nHarrera osoan zehar zure zalantzak argitzen ditugu\nElkarrekin bilatzen dugu haren behin betiko familia", 'textarea' ),
|
||||
'image' => array( 'type' => 'image', 'label' => 'Foto', 'default' => 0 ),
|
||||
'caption' => $t( 'Pie de foto', '', '' ),
|
||||
'button' => $t( 'Botón', 'Quiero ser casa de acogida', 'Harrera-etxe izan nahi dut' ),
|
||||
),
|
||||
),
|
||||
'give' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Donaciones',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Puerta cuatro · Dona', 'Laugarren atea · Dohaintza' ),
|
||||
'title' => $t( 'Título', 'Cada ayuda se nota', 'Laguntza oro nabaritzen da' ),
|
||||
'text' => $t( 'Texto', 'Con tu aportación compramos pienso, medicinas y todo lo que necesitan mientras esperan una familia.', 'Zure ekarpenarekin pentsua, sendagaiak eta familia baten zain dauden bitartean behar duten guztia erosten dugu.', 'textarea' ),
|
||||
'card_title' => $t( 'Tarjeta · título', 'Cómo donar', 'Nola eman' ),
|
||||
'card_text' => $t( 'Tarjeta · texto', 'Escríbenos y te indicamos cómo hacer una aportación económica o dónde traer material. ¡Gracias!', 'Idatzi iezaguzu eta diru-ekarpena nola egin edo materiala non ekarri azalduko dizugu. Eskerrik asko!', 'textarea' ),
|
||||
'shortcode' => array( 'type' => 'text', 'label' => 'Formulario de donación (opcional): pega aquí el shortcode de GiveWP, p. ej. [give_form id="12"]', 'default' => '' ),
|
||||
'button' => $t( 'Botón', 'Quiero donar', 'Dohaintza egin nahi dut' ),
|
||||
'needs_title' => $t( 'Necesidades · título', 'Lo que más necesitamos', 'Gehien behar duguna' ),
|
||||
'needs' => $t( 'Necesidades (una línea por punto)',
|
||||
"Pienso para perros y gatos\nArena para gatos\nMantas, toallas y camas\nCorreas, collares y juguetes",
|
||||
"Txakur eta katuentzako pentsua\nKatuentzako harea\nMantak, eskuoihalak eta oheak\nUhalak, lepokoak eta jostailuak", 'textarea' ),
|
||||
),
|
||||
),
|
||||
'stats' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Cifras',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Nuestro impacto', 'Gure eragina' ),
|
||||
'title' => $t( 'Título', 'Cada número es una vida', 'Zenbaki bakoitza bizitza bat da' ),
|
||||
'num1' => array( 'type' => 'text', 'label' => 'Cifra 1', 'default' => '+25' ),
|
||||
'label1' => $t( 'Cifra 1 · texto', 'años cuidando animales', 'urte animaliak zaintzen' ),
|
||||
'num2' => array( 'type' => 'text', 'label' => 'Cifra 2', 'default' => '2' ),
|
||||
'label2' => $t( 'Cifra 2 · texto', 'municipios: Irun y Hondarribia', 'udalerri: Irun eta Hondarribia' ),
|
||||
'num3' => array( 'type' => 'text', 'label' => 'Cifra 3', 'default' => '100%' ),
|
||||
'label3' => $t( 'Cifra 3 · texto', 'con microchip, vacunas y esterilización', 'mikrotxip, txerto eta antzutzearekin' ),
|
||||
'num4' => array( 'type' => 'text', 'label' => 'Cifra 4 (vacío = ocultar)', 'default' => '' ),
|
||||
'label4' => $t( 'Cifra 4 · texto', '', '' ),
|
||||
),
|
||||
),
|
||||
'stories' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Historias con final feliz',
|
||||
'section' => true,
|
||||
'description' => 'Muestra automáticamente los últimos animales marcados como «Adoptado». Si no hay ninguno, la sección no aparece.',
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Ya están en casa', 'Etxean daude jada' ),
|
||||
'title' => $t( 'Título', 'Historias con final feliz', 'Amaiera zoriontsuko istorioak' ),
|
||||
'text' => $t( 'Texto', 'Gracias a las familias que les abrieron su casa.', 'Eskerrik asko etxeko ateak ireki zizkieten familiei.', 'textarea' ),
|
||||
'count' => array( 'type' => 'number', 'label' => 'Número de animales', 'default' => 8, 'min' => 1, 'max' => 24 ),
|
||||
'view' => array( 'type' => 'select', 'label' => 'Presentación', 'default' => 'carrusel', 'choices' => array(
|
||||
'carrusel' => 'Carrusel (se desliza)',
|
||||
'rejilla' => 'Rejilla',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
'intake' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Si necesitas ayuda (perdidos, encontrados…)',
|
||||
'section' => true,
|
||||
'fields' => array_merge(
|
||||
array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Si eres tú quien necesita ayuda', 'Laguntza behar duzuna zu bazara' ),
|
||||
'title' => $t( 'Título', 'Perdidos, encontrados y entregas', 'Galduak, aurkituak eta entregak' ),
|
||||
),
|
||||
$card( 'caso', 1, array( 'He perdido a mi animal', 'Nire animalia galdu dut' ),
|
||||
array( 'Llámanos cuanto antes y avisa a la Policía Municipal. Los animales que se recogen en Irun y Hondarribia llegan a nuestras instalaciones: el microchip actualizado es la forma más rápida de volver a casa.',
|
||||
'Deitu iezaguzu lehenbailehen eta jakinarazi Udaltzaingoari. Irunen eta Hondarribian jasotzen diren animaliak gure instalazioetara iristen dira: mikrotxipa eguneratuta izatea da etxera itzultzeko modurik azkarrena.' ) ),
|
||||
$card( 'caso', 2, array( 'He encontrado un animal', 'Animalia bat aurkitu dut' ),
|
||||
array( 'Si está en la calle en Irun u Hondarribia, avisa a la Policía Municipal: ellos lo recogen y lo traen a Gure Ametsa, donde pasa control veterinario y le buscamos a su familia.',
|
||||
'Irunen edo Hondarribian kalean badago, jakinarazi Udaltzaingoari: haiek jaso eta Gure Ametsara ekartzen dute, non albaitari-kontrola egiten zaion eta bere familia bilatzen diogun.' ) ),
|
||||
$card( 'caso', 3, array( 'No puedo seguir cuidándolo', 'Ezin dut gehiago zaindu' ),
|
||||
array( 'Escríbenos o llámanos antes de tomar una decisión. Te escucharemos sin juzgarte y buscaremos juntos la mejor salida para él.',
|
||||
'Idatzi edo deitu iezaguzu erabaki bat hartu aurretik. Epaitu gabe entzungo dizugu eta elkarrekin bilatuko dugu harentzat irtenbiderik onena.' ) )
|
||||
),
|
||||
),
|
||||
'faq' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Preguntas frecuentes',
|
||||
'section' => true,
|
||||
'fields' => array_merge(
|
||||
array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Dudas', 'Zalantzak' ),
|
||||
'title' => $t( 'Título', 'Preguntas frecuentes', 'Ohiko galderak' ),
|
||||
),
|
||||
$qa( 1, '¿Qué incluye la adopción?', 'Todos los animales se entregan con microchip, vacunas al día, desparasitados y esterilizados, como marca la Ley de Bienestar Animal.',
|
||||
'Zer barne hartzen du adopzioak?', 'Animalia guztiak mikrotxiparekin, txertoak egunean, desparasitatuta eta antzututa ematen dira, Animalien Ongizaterako Legeak agintzen duen bezala.' ),
|
||||
$qa( 2, '¿Puedo ir a conocerlos?', 'Sí. Estamos en Jaizubia, 44 (Hondarribia), de lunes a viernes de 10:00 a 13:00 y de 14:00 a 19:00. Llámanos antes para organizar la visita.',
|
||||
'Joan naiteke haiek ezagutzera?', 'Bai. Jaizubian gaude, 44 (Hondarribia), astelehenetik ostiralera 10:00etatik 13:00etara eta 14:00etatik 19:00etara. Deitu aurretik bisita antolatzeko.' ),
|
||||
$qa( 3, '¿Puedo ser casa de acogida o voluntario/a?', 'Sí, nos ayuda muchísimo. Escríbenos desde el formulario de contacto y te contamos cómo empezar.',
|
||||
'Harrera-etxe edo boluntario izan naiteke?', 'Bai, asko laguntzen digu. Idatzi iezaguzu harremanetarako formularioaren bidez eta nola hasi kontatuko dizugu.' ),
|
||||
$qa( 4, '¿Cuidáis de mi perro o gato en vacaciones?', 'Sí, tenemos hotel para perros y gatos. Consulta disponibilidad con antelación, sobre todo en verano.',
|
||||
'Nire txakurra edo katua zaintzen duzue oporretan?', 'Bai, txakur eta katuentzako hotela dugu. Galdetu erabilgarritasuna aldez aurretik, batez ere udan.' ),
|
||||
$qa( 5, '', '', '', '' )
|
||||
),
|
||||
),
|
||||
'content' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Contenido libre de la página «Inicio»',
|
||||
'section' => true,
|
||||
'description' => 'Lo que escribáis en la página Inicio (y en «Hasiera» para euskera) con el editor de bloques. Ideal para añadir patrones de «Gure Ametsa».',
|
||||
'fields' => array(),
|
||||
),
|
||||
'visit' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Hotel y visita',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Visítanos', 'Etorri gu ikustera' ),
|
||||
'title' => $t( 'Título', 'Estamos en Jaizubia', 'Jaizubian gaude' ),
|
||||
'text' => $t( 'Texto', 'Ven a conocer a los animales. Y si te vas de vacaciones, también cuidamos de tu perro o gato en nuestro hotel.', 'Etorri animaliak ezagutzera. Eta oporretara bazoaz, zure txakurra edo katua ere zaintzen dugu gure hotelean.', 'textarea' ),
|
||||
'image' => array( 'type' => 'image', 'label' => 'Foto del hotel o las instalaciones', 'default' => 0 ),
|
||||
'button' => $t( 'Botón del hotel', 'Hotel para perros y gatos', 'Txakur eta katuentzako hotela' ),
|
||||
),
|
||||
),
|
||||
'talk' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Contacto con formulario',
|
||||
'section' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Hablemos', 'Hitz egin dezagun' ),
|
||||
'title' => $t( 'Título', 'Habla con una persona', 'Hitz egin pertsona batekin' ),
|
||||
'text' => $t( 'Texto', 'Adopciones, acogidas, voluntariado, hotel o un animal perdido: escríbenos y te responde alguien del equipo.', 'Adopzioak, harrerak, boluntariotza, hotela edo animalia galdu bat: idatzi iezaguzu eta taldeko norbaitek erantzungo dizu.', 'textarea' ),
|
||||
'form_title' => $t( 'Título del formulario', 'Escríbenos', 'Idatzi iezaguzu' ),
|
||||
),
|
||||
),
|
||||
'help' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Formas de ayudar (tarjetas)',
|
||||
'section' => true,
|
||||
'hidden' => true,
|
||||
'fields' => array(
|
||||
'eyebrow' => $t( 'Antetítulo', 'Colabora', 'Lagundu' ),
|
||||
'title' => $t( 'Título', 'Hay muchas formas de ayudar', 'Laguntzeko modu asko daude' ),
|
||||
'text' => $t( 'Texto', 'No hace falta adoptar para cambiar la vida de un animal.', 'Ez da beharrezkoa adoptatzea animalia baten bizitza aldatzeko.', 'textarea' ),
|
||||
),
|
||||
),
|
||||
'species' => array(
|
||||
'panel' => 'ga_home',
|
||||
'title' => 'Perros y gatos (accesos con foto)',
|
||||
'section' => true,
|
||||
'hidden' => true,
|
||||
'fields' => array(
|
||||
'title' => $t( 'Título (vacío = ocultar)', '¿A quién vas a conocer hoy?', 'Nor ezagutuko duzu gaur?' ),
|
||||
'dog_label' => $t( 'Perros · texto', 'Conoce a los perros', 'Ezagutu txakurrak' ),
|
||||
'dog_image' => array( 'type' => 'image', 'label' => 'Perros · foto', 'default' => 0 ),
|
||||
'cat_label' => $t( 'Gatos · texto', 'Conoce a los gatos', 'Ezagutu katuak' ),
|
||||
'cat_image' => array( 'type' => 'image', 'label' => 'Gatos · foto', 'default' => 0 ),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Cada sección de portada tiene «Mostrar» y «Orden» (el orden del registro es el inicial).
|
||||
$order = 10;
|
||||
foreach ( $registry as $id => &$section ) {
|
||||
if ( ! empty( $section['section'] ) ) {
|
||||
$section['fields'] = array(
|
||||
'show' => array( 'type' => 'checkbox', 'label' => 'Mostrar esta sección', 'default' => empty( $section['hidden'] ) ),
|
||||
'order' => array( 'type' => 'number', 'label' => 'Orden (menor = más arriba)', 'default' => $order, 'min' => 0, 'max' => 200 ),
|
||||
) + $section['fields'];
|
||||
$order += 10;
|
||||
}
|
||||
}
|
||||
unset( $section );
|
||||
|
||||
return $registry;
|
||||
}
|
||||
Reference in New Issue
Block a user