Created
December 11, 2017 19:56
-
-
Save tripflex/b3b016a05f107daccc6470d4678cf7b2 to your computer and use it in GitHub Desktop.
Chosen support for standard WP Job Manager Dropdown Fields
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 | |
// ^ there should ONLY be one of these at the top of child theme's functions.php file or use the Code Snippets plugin | |
// THIS IS JUST ANOTHER EXAMPLE USING THE CODE BELOW TO ONLY LOAD ON THE SUBMIT/EDIT LISTING PAGE IF YOU DONT KNOW | |
// HOW TO ADD YOUR OWN CUSTOM JAVASCRIPT | |
// THIS EXAMPLE IS FOR A FIELD WITH THE META KEY OF "candidate_current_title" ... duplicate that line below to add support | |
// for additional fields | |
add_action( 'submit_job_form_start', 'my_custom_jquery_init_chosen_on_selects' ); | |
function my_custom_jquery_init_chosen_on_selects(){ | |
echo "<script> | |
jQuery( function($){ | |
$( '#candidate_current_title' ).chosen(); | |
}); | |
</script>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment