Skip to content

Instantly share code, notes, and snippets.

View Marcoevich's full-sized avatar

Rick Marcoevich

  • Breda, The Netherlands
  • 14:59 (UTC +02:00)
View GitHub Profile
@Marcoevich
Marcoevich / ru-custom-children.php
Created June 27, 2018 11:24
Fix age calculation
$calculateAge = DateTime::createFromFormat('d/m/Y', $birthdate, $tz);
if($calculateAge) {
$age = $calculateAge->diff(new DateTime('now', $tz))->y;
}
@Marcoevich
Marcoevich / execphp.php
Created July 6, 2018 11:25
Removing create_function from WordPress PHP Widget
function phpcodewidget_register_widgets() {
register_widget( 'PHP_Code_Widget' );
}
add_action('widgets_init', 'phpcodewidget_register_widgets' );