Why this piece of code causes a 500 error on the site?
is the add_shortcode('in', 'in'); function in(){ global $post; if(get_post_meta($post->ID, 'work')){ $work = get_post_meta($post->ID, 'work'); foreach ($work as $options) { foreach ($options as $key) { if ($key == "in") { $hour = get_post_meta($post->ID, 'app_price_1hour'); $2hour = get_post_meta($post->ID, 'app_price_2hour'); $night = get_post_meta($post->ID, 'app_price_night'); $output = "ApartmentsPrice per hour: us$". $hour[0]."Price for 2 hours: us$". $2hour[0]."Price per night: us$". $night[0].""; return $output; } } } unset($work, $options, $key, $output, $hour, $2hour, $night); } }