Where are you retrieving the value of the “wi-fi” tag from? Is it a constant? If it is a constant, then you need to declare it like this: $posttags = ‘wi-fi’;
<?php
/*
Plugin Name: MySite-plugin
Description: Site specific code changes for example.com
*/
/* Start Adding Functions Below this Line */
function wpb_author_info_box( $content ) {
global $post;
// Detect if it is a single post with a post author
if ( is_single() && isset( $post->post_author ) ) {
// Get author's display name
$display_name = get_the_author_meta( 'display_name', $post->post_author );
// If display name is not available then use nickname as display name
if ( empty( $display_name ) )
$display_name = get_the_author_meta( 'nickname', $post->post_author );
// Get author's biographical information or description
$user_description = get_the_author_meta( 'user_description', $post->post_author );
// Get agency period of rentals
$periodo_affitti = get_the_author_meta( 'periodo_affitti', $post->post_author );
$titolo_affitti = '<h4 class="titolo_affitti">Periodo affitti</h4>';
// Get check-in e check-out
$orari = get_the_author_meta( 'orari', $post->post_author );
$titolo_orari = '<h4 class="titolo_affitti">Ingresso e riconsegna</h4>';
// Get prezzo non include
$tassa_soggiorno = '<div class="tassa_soggiorno">'. get_the_author_meta( 'tassa_soggiorno', $post->post_author ) .'</div>';
$supplemento_animali = '<div class="tassa_soggiorno">'. get_the_author_meta( 'supplemento_animali', $post->post_author ) .'</div>';
$supplemento_culla = '<div class="tassa_soggiorno">'. get_the_author_meta( 'supplemento_culla', $post->post_author ) .'</div>';
$importo_cauzione = '<div class="tassa_soggiorno">'. get_the_author_meta( 'importo_cauzione', $post->post_author ) .'</div>';
$servizio_spiaggia = '<div class="tassa_soggiorno">'. get_the_author_meta( 'servizio_spiaggia', $post->post_author ) .'</div>';
$suppl_soggiorni_brevi = '<div class="tassa_soggiorno">'. get_the_author_meta( 'suppl_soggiorni_brevi', $post->post_author ) .'</div>';
$pulizia_esc = '<div class="tassa_soggiorno">'. get_the_author_meta( 'pulizia_esc', $post->post_author ) .'</div>';
$posttags = 'wi-fi';
$wi_fi_esc = '';
if (isset($posttags)) { $wi_fi_esc = '<div class="wi_fi_esc">' . get_the_author_meta('wi_fi_esc', $post->post_author) . '</div>'; }
$biancheria_esc = '<div class="biancheria_esc">'. get_the_author_meta( 'biancheria_esc', $post->post_author ) .'</div>';
$asciugamani_esc = '<div class="asciugamani_esc">'. get_the_author_meta( 'asciugamani_esc', $post->post_author ) .'</div>';
$titolo_prezzo_non_include = '<h4 class="titolo_affitti">Il prezzo non include:</h4>';
//prezzo include
$locazione = '<div class="tassa_soggiorno">'. get_the_author_meta( 'locazione', $post->post_author ) .'</div>';
$commissione = '<div class="tassa_soggiorno">'. get_the_author_meta( 'commissione', $post->post_author ) .'</div>';
$consumi = '<div class="tassa_soggiorno">'. get_the_author_meta( 'consumi', $post->post_author ) .'</div>';
$pulizia_inc = '<div class="tassa_soggiorno">'. get_the_author_meta( 'pulizia_inc', $post->post_author ) .'</div>';
$biancheria_inc = '<div class="tassa_soggiorno">'. get_the_author_meta( 'biancheria_inc', $post->post_author ) .'</div>';
$ac_inc = '<div class="tassa_soggiorno">'. get_the_author_meta( 'ac_inc', $post->post_author ) .'</div>';
$titolo_prezzo_include = '<h4 class="titolo_affitti">Il prezzo include:</h4>';
// Get saldo
$saldo = '<div class="saldo">'. get_the_author_meta( 'saldo', $post->post_author ) .'</div>';
// Get author's website URL
$user_website = get_the_author_meta('url', $post->post_author);
// Get link to the author archive page
$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
if ( ! empty( $display_name ) )
$author_details = '<h4 class="author_name">Condizioni di pagamento ID: ' . get_the_ID(). '</h4>';
if ( ! empty( $user_description ) )
// Author avatar and bio
$author_details .= '<p class="author_details">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';
$author_details .= '<p class="author_links"><a href="'. $user_posts .'">View all posts by ' . $display_name . '</a>';
// Check if author has a website in their profile
if ( ! empty( $user_website ) ) {
// Display author website link
$author_details .= ' | <a href="' . $user_website .'" target="_blank" rel="nofollow">Website</a></p>';
} else {
// if there is no author website then just close the paragraph
$author_details .= '</p>';
}
// Pass all this info to post content
$content = $content . $titolo_prezzo_include . $locazione . $commissione . $consumi . $pulizia_inc . $biancheria_inc . $ac_inc . $titolo_prezzo_non_include . $pulizia_esc . $tassa_soggiorno . $supplemento_animali . $supplemento_culla . $importo_cauzione . $servizio_spiaggia . $suppl_soggiorni_brevi . $biancheria_esc . $asciugamani_esc . $wi_fi_esc . $ac_esc . $saldo . '<footer class="author_bio_section" >'. $author_details . $titolo_affitti . $periodo_affitti . $titolo_orari . $orari .'</footer>';
}
return $content;
}
// Add our function to the post content filter
add_action( 'the_content', 'wpb_author_info_box' );
// Allow HTML in author bio section
remove_filter('pre_user_description', 'wp_filter_kses');
/* Stop Adding Functions Below this Line */
?>