I'd like to modify the following

$array = array(
210 => array(

'id' => '210',
    'name' => 'animali permessi su richiesta'
216 => array(
    'id' => '216',
    'name' => 'aria condizionata'


foreach ($array as $c) {
// Access the required data
$id = $c['id'];
$name = $c['name'];

print "<input type='checkbox' name='$name' id='$id'>";

First I dont need "print" as output. I'd create a variable to insert in this form output (inside a shortcode). It's a search box for filtering the posts, method="get", operator AND

$output = '<form class="sacconi_form" method="get" action="' . home_url('/') . '">' .
          $categories . $taxonomy . $functionOspitiDropdown . $functionCamereDropdown . $functionBagniDropdown . $functionNumberDropdown . '<br><br>' .
          '<input type="submit" name="search" value="' . esc_html__('Search', 'sacconicase') . '">' .

return $output;


Any idea to adapt the first part to the second one? keep also in mind that each tag will also filtered in another function according to the locale (I have already custom fields for each tag and for each foreigner language)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.