Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Add script file, for ACF
Browse files Browse the repository at this point in the history
Loads when ACF input fields are rendered
  • Loading branch information
Salman Z Kaleem committed Jul 15, 2015
1 parent dc754c0 commit 719e449
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 12 additions & 0 deletions uc-people.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
jQuery(document).ready(function($){
if( $('#acf-field-netid_lookup').length ){
$('#acf-field-netid_lookup').keyup(function(e){
if( e.target.value.length > 2 ){
var netidQuery = e.target.value;
/**
* Ajax lookup with netidQuery
*/
}
});
}
});
8 changes: 7 additions & 1 deletion uc-people.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,10 @@ function uc_people_settings_page(){

</div>
<?php
}
}

function uc_acf_admin_enqueue_scripts(){
wp_enqueue_script( 'ucpeoplejs', plugin_dir_url(__FILE__).'/uc-people.js', array('jquery'), '1.0' );
}

add_action('acf/input/admin_enqueue_scripts', 'uc_acf_admin_enqueue_scripts');

0 comments on commit 719e449

Please sign in to comment.