';
if ( $this->prefix ) {
echo '' . $this->prefix . '';
}
if ( $this->get_option() == "" ) {
$value = $this->default;
}
else {
$value = $this->get_option();
}
if ( $args["for_bank"] == true ) {
$value = $this->default;
}
echo '';
if ( $this->suffix ) {
echo '' . $this->suffix . '';
}
echo '';
// If called from the front end, needs to enqueue some extra files
if ( !is_admin() ) {
add_filter( 'tpl_admin_js_strings', array( $this, 'admin_js_strings' ) );
wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery', 'jquery-ui-core' ) );
wp_enqueue_style( 'tpl-common-style', tpl_base_uri() . '/framework/style/common.min.css', array(), false );
}
}
// Formats the option into value: uses the date format saved in WP-Admin
public function format_option ( $value, $args = array() ) {
return date( get_option( 'date_format' ), strtotime( $value ) );
}
// Strings to be added to the admin JS files
public function admin_js_strings( $strings ) {
$strings = array_merge( $strings, array(
'date_starts_with' => get_option( 'start_of_week' ),
) );
return $strings;
}
}