feat: prima versione del plugin, blocco e shortcode con iframe stampato lato server

This commit is contained in:
Lorenzo Iovino 2026-09-04 15:32:47 +02:00
commit 5c73bbc2b8
20 changed files with 1562 additions and 0 deletions

28
includes/shortcode.php Normal file
View file

@ -0,0 +1,28 @@
<?php
/**
* The [piazza-in-festa] shortcode.
*
* Attribute names are Italian because the data is Italian: they match the town
* identifiers and the parameters documented on piazzainfesta.it, so what you
* read there is what you write here.
*
* [piazza-in-festa comuni="alba,barolo,la-morra" limite="5"]
* [piazza-in-festa regione="Piemonte" categoria="sagra_enogastronomica"]
*
* @package PiazzaInFesta
*/
defined( 'ABSPATH' ) || exit;
/**
* Renders the shortcode.
*
* @param array|string $atts Shortcode attributes.
* @return string HTML.
*/
function pinfesta_shortcode( $atts ) {
$args = shortcode_atts( pinfesta_defaults(), $atts, 'piazza-in-festa' );
return pinfesta_render_iframe( $args );
}
add_shortcode( 'piazza-in-festa', 'pinfesta_shortcode' );