Last active
October 21, 2021 23:51
-
-
Save pavelrich/afce0520ea69878e4097460c00517fe3 to your computer and use it in GitHub Desktop.
FORQY — Custom Settings of the jQuery UI Datepicker — Disable selection of today
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'prefix_scripts_datepicker' ) ) { | |
/** | |
* Custom Settings of the jQuery UI Datepicker | |
*/ | |
function prefix_scripts_datepicker() { | |
$datepicker = ' | |
(function ($) { | |
"use strict"; | |
// Disable selection of today | |
$(".js-datepicker").datepicker("option", "minDate", 1); | |
}(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
hi Pavel. Any advice on getting the datepicker to work again on linguni theme? The dates don't pop up and our customers cant select a date. TypeError: undefined is not a function (near '...$('.js-datepicker').datepicker...')