diff --git a/cmb2-field-ajax-search.php b/cmb2-field-ajax-search.php index cd7ca84..f69f335 100644 --- a/cmb2-field-ajax-search.php +++ b/cmb2-field-ajax-search.php @@ -179,8 +179,8 @@ if( ! class_exists( 'CMB2_Field_Ajax_Search' ) ) { */ public function setup_admin_scripts() { - wp_register_script( 'jquery-autocomplete', plugins_url( 'js/jquery.autocomplete.min.js', __FILE__ ), array( 'jquery' ), self::VERSION ); - wp_register_script( 'cmb-ajax-search', plugins_url( 'js/ajax-search.js', __FILE__ ), array( 'jquery', 'jquery-autocomplete', 'jquery-ui-sortable' ), self::VERSION ); + wp_register_script( 'jquery-autocomplete', plugins_url( 'js/jquery.autocomplete.min.js', __FILE__ ), array( 'jquery' ), self::VERSION, true ); + wp_register_script( 'cmb-ajax-search', plugins_url( 'js/ajax-search.js', __FILE__ ), array( 'jquery', 'jquery-autocomplete', 'jquery-ui-sortable' ), self::VERSION, true ); wp_localize_script( 'cmb-ajax-search', 'cmb_ajax_search', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), diff --git a/readme.md b/readme.md index 4ec9245..2f37c13 100644 --- a/readme.md +++ b/readme.md @@ -75,7 +75,7 @@ function cmb2_ajax_search_metabox() { 'name' => __( 'Attached user', 'cmb2' ), 'desc' => __( 'Field description (optional)', 'cmb2' ), 'id' => $prefix . 'user', - 'type' => 'post_ajax_search', + 'type' => 'user_ajax_search', 'query_args' => array( 'role' => array( 'Subscriber' ), 'search_columns' => array( 'user_login', 'user_email' ) @@ -87,7 +87,7 @@ function cmb2_ajax_search_metabox() { 'name' => __( 'Multiple users', 'cmb2' ), 'desc' => __( 'Field description (optional)', 'cmb2' ), 'id' => $prefix . 'users', - 'type' => 'post_ajax_search', + 'type' => 'user_ajax_search', 'multiple' => true, 'limit' => 5, 'query_args' => array( @@ -100,7 +100,7 @@ function cmb2_ajax_search_metabox() { 'name' => __( 'Attached term', 'cmb2' ), 'desc' => __( 'Field description (optional)', 'cmb2' ), 'id' => $prefix . 'term', - 'type' => 'post_ajax_search', + 'type' => 'term_ajax_search', 'query_args' => array( 'taxonomy' => 'category', 'childless' => true @@ -112,7 +112,7 @@ function cmb2_ajax_search_metabox() { 'name' => __( 'Multiple terms', 'cmb2' ), 'desc' => __( 'Field description (optional)', 'cmb2' ), 'id' => $prefix . 'terms', - 'type' => 'post_ajax_search', + 'type' => 'term_ajax_search', 'multiple' => true, 'limit' => -1, 'query_args' => array(