<?php
$city = "Москва";
the_content('');
?>
add_shortcode( 'wp_city', 'wp_city' );
if ( ! function_exists( 'wp_city' ) ) {
/**
* Add shortcode with city [wp_city city=""]
*
* @param array $atts shortcode attributes.
*
* @return string
*/
function wp_city( $atts ) {
// Define a white list of attributes.
$atts = shortcode_atts( array(
'city' => __( 'Moscow', 'default' ),
), $atts );
$output = '<span class="current-city">' . esc_html( $atts['city'] ) . '</span>';
return apply_filters( 'wp_city', $output );
}
}