У меня возникли проблемы с добавлением библиотек jquery в пользовательский плагин WordPress.Он говорит мне, что не может найти переменную jQuery.Буду признателен за любую оказанную помощь.
simplepluginclass.php
включает functions.php
include plugin_dir_path( __FILE__ ) . 'inc/functions.php';
functions.php
<?php
function register_jqscripts() {
wp_enqueue_script('jQuery', 'http://code.google.com/apis/libraries/devguide.html#jquery');
wp_enqueue_script('jquery-ui-core', 'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('jquery-ui-css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
}
function add_datepicker(){ ?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#dob').datepicker({
dateFormat: 'dd-mm-yy'
});
});
</script>
<?php
}
add_action( 'register_form', 'register_jqscripts' );
add_action('register_form','add_datepicker');
?>
simplepluginclass.php
<label for="dob"><?php _e( 'Date of Birth', 'sportspress' ) ?><br />
<input type="date" class="customdatepicker" id="dob" name="dob" />
</label>