Use touch_time() on front-end form via plugin

You might try to include the the template.php file:

<?php 
if( ! function_exists( 'touch_time' ) )
{
    require_once( ABSPATH . '/wp-admin/includes/template.php' );
    touch_time( 0, 0, 5 ); 
}
?>

but I think it might be better to just copy the code from the touch_time() function into your own function and modify accordingly.

Friday part of the answer:

“A Big Mess” and “Black Magic”

According to the inline documentation, that file is a Big Mess 😉

/**
 * Template WordPress Administration API.
 *
 * A Big Mess. Also some neat functions that are nicely written.
 *

and watch out for the Black Magic in the /wp-includes/rewrite.php file:

 /**
  * Generate rewrite rules from a permalink structure.
  *
  * The main WP_Rewrite function for building the rewrite rule list. The
  * contents of the function is a mix of black magic and regular expressions,
  * so best just ignore the contents and move to the parameters.
  *

so be aware what you include in your plugin 😉

Leave a Comment