Skip to content

Instantly share code, notes, and snippets.

@alanef
Last active November 22, 2020 16:13
Show Gist options
  • Select an option

  • Save alanef/57695262bca9f44314d90df33a22d51b to your computer and use it in GitHub Desktop.

Select an option

Save alanef/57695262bca9f44314d90df33a22d51b to your computer and use it in GitHub Desktop.
Example
/* before doing this check if $_GET['event_id'] is set e.g.
if ( ! isset($_GET['event_id']) {
// return or do error stuff
}
*/
$event_id=sanitize_text_field($_GET['event_id']);
$event_id=wp_unslash($event_Id);
$date = get_post_meta($event_id, '_mdjm_event_date', true );
/* or combine it all */
$date = get_post_meta(
wp_unslash(
sanitize_text_field(
$_GET['event_id']
)
),
'_mdjm_event_date',
true
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment