Can’t get jquery to work in Admin
-
I have a custom metabox for posts which I need to be a date field on the backend for editors.
My plugin starts with the following code to enqueue jquery:
function load_datepicker() { wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style('jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css'); } add_action( 'admin_enqueue_scripts', 'load_datepicker' );
But it does not work – my field shows up but the datepicker does not show when you click on it.
However, if I activate the classic editor plugin my code works perfectly.
What do I need to change to make this work in gutenberg (without the classic editor plugin)?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can’t get jquery to work in Admin’ is closed to new replies.