Created
November 16, 2013 16:29
-
-
Save gfargo/7502176 to your computer and use it in GitHub Desktop.
Returns out Array of Hidden Inputs when received in the $_POST. This function is used in conjunction with the Placester Wordpress Real Estate IDX Plugin. It's purpose is to allow the user to pass an array through the $_POST variable - as opposed to straight AJAX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render_post_array ($group = 'location', $key = 'postal') { | |
if ($_POST['location'] && is_array($_POST['location']['postal'])) { | |
$output = ''; | |
foreach ($_POST[$group][$key] as $value) { | |
$output .= '<input type="hidden" name="'.$group.'['.$key.'][]" value="' . $value .'" >'; | |
} | |
$output .= '<input type="hidden" name="'.$group.'['.$key.'][]" value="in" >'; | |
} | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment