28 lines
780 B
PHP
28 lines
780 B
PHP
<?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' );
|