Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active December 27, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/7261267 to your computer and use it in GitHub Desktop.
Save hissy/7261267 to your computer and use it in GitHub Desktop.
[WordPress / Trust Form] Set the default value from $_GET
<?php
function trust_form_show_input() {
global $trust_form;
$col_name = $trust_form->get_col_name();
$validate = $trust_form->get_validate();
$config = $trust_form->get_config();
$attention = $trust_form->get_attention();
// set default value
foreach ( $col_name as $key => $value ) {
if ($value == 'イベント名') {
$_POST[$key] = esc_attr($_GET['event_name']);
}
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment