'!Ymd', '/^\d{4}-\d{2}-\d{2}$/' => '!Y-m-d', '/^\d{2}\/\d{2}\/\d{4}$/' => '!d/m/Y', ); foreach ( $formats as $pattern => $format ) { if ( preg_match( $pattern, $value ) ) { $date = DateTimeImmutable::createFromFormat( $format, $value, $tz ); return $date instanceof DateTimeImmutable ? $date : null; } } return null; } function lnz_current_event_id() { $event_id = (int) get_queried_object_id(); return $event_id && LNZ_EVENT_CPT === get_post_type( $event_id ) ? $event_id : 0; } function lnz_related_program_ids( $event_id ) { $value = lnz_raw_field( LNZ_EVENT_PROGRAMS, $event_id ); if ( empty( $value ) ) { return array(); } $value = is_array( $value ) ? $value : array( $value ); $ids = array(); foreach ( $value as $item ) { if ( $item instanceof WP_Post ) { $ids[] = (int) $item->ID; } elseif ( is_numeric( $item ) ) { $ids[] = (int) $item; } } return array_values( array_unique( array_filter( $ids ) ) ); } /* Filtra el Loop Grid para mostrar solo los programas relacionados con el evento. */ function lnz_elementor_program_query( $query ) { $event_id = lnz_current_event_id(); $ids = $event_id ? lnz_related_program_ids( $event_id ) : array(); $query->set( 'post_type', LNZ_PROGRAM_CPT ); $query->set( 'post_status', 'publish' ); $query->set( 'post__in', $ids ? $ids : array( 0 ) ); $query->set( 'posts_per_page', -1 ); $query->set( 'ignore_sticky_posts', true ); $query->set( 'no_found_rows', true ); $start = $event_id ? lnz_parse_date( lnz_raw_field( LNZ_EVENT_START, $event_id ) ) : null; $end = $event_id ? lnz_parse_date( lnz_raw_field( LNZ_EVENT_END, $event_id ) ) : null; if ( $start && $end && $end >= $start ) { $meta_query = $query->get( 'meta_query' ); $meta_query = is_array( $meta_query ) ? $meta_query : array(); $meta_query[] = array( 'key' => LNZ_PROGRAM_DATE, 'value' => array( $start->format( 'Ymd' ), $end->format( 'Ymd' ) ), 'compare' => 'BETWEEN', 'type' => 'NUMERIC', ); $query->set( 'meta_query', $meta_query ); } $query->set( 'meta_key', LNZ_PROGRAM_DATE ); $query->set( 'orderby', array( 'meta_value_num' => 'ASC', 'menu_order' => 'ASC', 'title' => 'ASC', ) ); } add_action( 'elementor/query/' . LNZ_QUERY_ID, 'lnz_elementor_program_query' ); /* Añádelo una vez dentro de la plantilla Loop Item. */ function lnz_program_date_marker() { $program_id = (int) get_the_ID(); $date = lnz_parse_date( lnz_raw_field( LNZ_PROGRAM_DATE, $program_id ) ); if ( ! $date || LNZ_PROGRAM_CPT !== get_post_type( $program_id ) ) { return ''; } return sprintf( '', esc_attr( $date->format( 'Y-m-d' ) ) ); } add_shortcode( 'programa_fecha_data', 'lnz_program_date_marker' ); /* Shortcode que genera todos los días del evento y marca los que tienen programas. */ function lnz_program_filter_shortcode( $atts ) { $event_id = lnz_current_event_id(); if ( ! $event_id ) { return ''; } $atts = shortcode_atts( array( 'grid' => '#programacion-loop' ), $atts, 'filtro_programacion' ); $start = lnz_parse_date( lnz_raw_field( LNZ_EVENT_START, $event_id ) ); $end = lnz_parse_date( lnz_raw_field( LNZ_EVENT_END, $event_id ) ); if ( ! $start || ! $end || $end < $start ) { return current_user_can( 'edit_post', $event_id ) ? '

Revisa los nombres y valores de los campos ACF de inicio y finalización.

' : ''; } $counts = array(); foreach ( lnz_related_program_ids( $event_id ) as $program_id ) { $date = lnz_parse_date( lnz_raw_field( LNZ_PROGRAM_DATE, $program_id ) ); if ( $date && $date >= $start && $date <= $end ) { $key = $date->format( 'Y-m-d' ); $counts[ $key ] = isset( $counts[ $key ] ) ? $counts[ $key ] + 1 : 1; } } $months = array( 1 => 'ENE', 'FEB', 'MAR', 'ABR', 'MAY', 'JUN', 'JUL', 'AGO', 'SEP', 'OCT', 'NOV', 'DIC' ); $period = new DatePeriod( $start, new DateInterval( 'P1D' ), $end->modify( '+1 day' ) ); $month = ''; ob_start(); ?>
format( 'Y-m-d' ); $month_key = $date->format( 'Y-m' ); $available = isset( $counts[ $key ] ); ?> format( 'n' ) ] ); ?> format( 'j' ) ); ?>
button.dataset.date === date) || null; } function getItems(grid) { const loopItems = Array.from(grid.querySelectorAll('.e-loop-item')); return loopItems.length ? loopItems : Array.from(grid.querySelectorAll('.elementor-loop-container > *')); } function applyFilter(filter, date) { let grid; try { grid = document.querySelector(filter.dataset.grid || '#programacion-loop'); } catch (error) { return; } if (!grid) return; filter.querySelectorAll('.lnz-program-day.is-available').forEach((button) => { const selected = Boolean(date && button.dataset.date === date); button.classList.toggle('is-selected', selected); button.setAttribute('aria-pressed', selected ? 'true' : 'false'); }); let visible = 0; getItems(grid).forEach((item) => { const marker = item.querySelector('.lnz-program-date'); const itemDate = marker ? marker.dataset.programDate : ''; const show = !date || itemDate === date; item.classList.toggle('lnz-program-hidden', !show); if (show) visible++; }); filter.dataset.selectedDate = date || ''; const message = filter.querySelector('.lnz-program-empty-message'); if (message) message.hidden = visible > 0; } function init() { document.querySelectorAll('.lnz-program-filter').forEach((filter) => { if (filter.dataset.initialized === '1') return; filter.dataset.initialized = '1'; const requested = new URL(window.location.href).searchParams.get('programacion_fecha') || ''; applyFilter(filter, findButton(filter, requested) ? requested : ''); }); } document.addEventListener('click', (event) => { const button = event.target.closest('.lnz-program-day.is-available'); if (!button) return; const filter = button.closest('.lnz-program-filter'); const date = button.classList.contains('is-selected') ? '' : button.dataset.date; applyFilter(filter, date); const url = new URL(window.location.href); date ? url.searchParams.set('programacion_fecha', date) : url.searchParams.delete('programacion_fecha'); window.history.replaceState({}, '', url.toString()); }); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } if (window.jQuery) { window.jQuery(window).on('elementor/frontend/init', init); } }()); JS; wp_add_inline_script( 'jquery', $js, 'after' ); } add_action( 'wp_enqueue_scripts', 'lnz_program_filter_assets', 20 );

THE NEW EDITION OF FLAMENCO FESTIVAL LONDON WILL CELEBRATE FLAMENCO AS A LIVING LANGUAGE IN CONSTANT TRANSFORMATION

THE NEW EDITION OF FLAMENCO FESTIVAL LONDON WILL CELEBRATE FLAMENCO AS A LIVING LANGUAGE IN CONSTANT TRANSFORMATION Ver vídeo Flamenco Festival London reaches its 21st edition championing flamenco as an artistic expression in permanent transformation, capable of preserving its essence while continuing to open itself to new languages. Under the slogan ‘Flamenco: Expanding Roots’, the […]

FLAMENCO FESTIVAL LONDRES ENCARA SU RECTA FINAL CON ROCÍO MOLINA, EL BALLET FLAMENCO DE ANDALUCÍA Y CALIFATO 3/4 COMO GRANDES PROTAGONISTAS

FLAMENCO FESTIVAL LONDRES ENCARA SU RECTA FINAL CON ROCÍO MOLINA, EL BALLET FLAMENCO DE ANDALUCÍA Y CALIFATO 3/4 COMO GRANDES PROTAGONISTAS La segunda mitad de la 21 edición del certamen reunirá en la capital británica algunas de las propuestas más destacadas del flamenco actual, desde la vanguardia escénica hasta la tradición más renovada Hasta el […]

25,500 SPECTATORS CELEBRATE 25 YEARS OF LOVE BETWEEN NEW YORK AND FLAMENCO

25,500 SPECTATORS CELEBRATE 25 YEARS OF LOVE BETWEEN NEW YORK AND FLAMENCO Flamenco Festival New York closes its 25th anniversary with an average attendance rate of 86% and 60% of its 40 performances sold out across New York, Miami, Tampa, Chicago, and Boston. Flamenco Festival New York wrapped up its 25th edition last Sunday—an especially […]

FLAMENCO FESTIVAL LONDRES ALCANZA SU 21 EDICIÓN

FLAMENCO FESTIVAL LONDRES ALCANZA SU 21 EDICIÓN Del 13 al 30 de junio, un total de 13 compañías ofrecerán 20 representaciones en espacios como el mítico Sadler’s Wells Theatre, Sadler’s Wells East, Lilian Baylis Studio, Jazz Café y la National Gallery en Londres; y, por primera vez, en Lowry (Mánchester) El programa reúne a artistas […]

FLAMENCO FESTIVAL LONDON REACHES ITS 21ST EDITION

FLAMENCO FESTIVAL LONDON REACHES ITS 21ST EDITION From 13 to 30 June, a total of 13 companies will present 20 performances in venues such as the iconic Sadler’s Wells Theatre, Sadler’s Wells East, Lilian Baylis Studio, Jazz Café and the National Gallery in London; and, for the first time, at Lowry (Manchester). The programme brings […]

FLAMENCO FESTIVAL NEW YORK HEADS INTO THE FINAL STRETCH OF ITS 25TH ANNIVERSARY WITH TRIBUTES FEATURING GERARDO NÚÑEZ, ANTONIO REY, ÁLVARO MARTINETE, AND OLGA PERICET

FLAMENCO FESTIVAL NEW YORK HEADS INTO THE FINAL STRETCH OF ITS 25TH ANNIVERSARY WITH TRIBUTES FEATURING GERARDO NÚÑEZ, ANTONIO REY, ÁLVARO MARTINETE, AND OLGA PERICET In addition to these stars, the festival continues through March 15 with performances by Sonia Olla & Ismael Fernández and the Manhattan Wind Ensemble. This week, artists like Gerardo Núñez, […]

FLAMENCO FESTIVAL NEW YORK CONTINUES CELEBRATING 25 YEARS OF LOVE WITH SARA BARAS, DANI DE MORÓN, ROSARIO “LA TREMENDITA,” AND ÁNGELES TOLEDANO

FLAMENCO FESTIVAL NEW YORK CONTINUES CELEBRATING 25 YEARS OF LOVE WITH SARA BARAS, DANI DE MORÓN, ROSARIO “LA TREMENDITA,” AND ÁNGELES TOLEDANO The festival, which runs through March 15, also welcomes in its second week Estévez/Paños y Compañía, Mara Rey, Raquel Heredia “La Repompa,” Jon Maya, and Andrés Marín, among many other leading figures of […]

Developed by Lienzzo