Answer the question
In order to leave comments, you need to log in
Why does this piece of code result in a 500 error on the site?
Why does this piece of code result in a 500 error on the site?
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 = "<h4>Апартаменты</h4><p><b>Цена за час:</b> ₪".$hour[0]."</p><p><b>Цена за 2 часа:</b> ₪".$2hour[0]."</p><p><b>Цена за ночь:</b> ₪".$night[0]."</p>";
return $output;
}
}
}
unset($work, $options, $key, $output, $hour, $2hour, $night);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question