Skip to content

Instantly share code, notes, and snippets.

@pavelrich
Last active October 22, 2021 00:04
Show Gist options
  • Save pavelrich/dc6e4406767c78f82c4da90dfb498471 to your computer and use it in GitHub Desktop.
Save pavelrich/dc6e4406767c78f82c4da90dfb498471 to your computer and use it in GitHub Desktop.
FORQY — Custom Settings of the jQuery UI Datepicker
<?php
if ( ! function_exists( 'prefix_scripts_datepicker' ) ) {
/**
* Custom Settings of the jQuery UI Datepicker
* @url https://api.jqueryui.com/datepicker/
*/
function prefix_scripts_datepicker() {
$datepicker = '
(function ($) {
"use strict";
$(".js-datepicker").datepicker(
// YOUR SETTINGS
);
}(jQuery));
';
wp_add_inline_script( 'jquery-ui-datepicker', $datepicker );
}
add_action( 'wp_enqueue_scripts', 'prefix_scripts_datepicker', 90 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment