Created
September 14, 2020 18:56
-
-
Save tripflex/8ce05922a4e2ae8f5a5b40e1d853706e to your computer and use it in GitHub Desktop.
Initialize Select2 on standard dropdown fields when using WP Job Manager Field Editor
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 | |
add_action( 'submit_job_form_start', 'my_custom_jquery_init_select2_on_selects' ); | |
function my_custom_jquery_init_select2_on_selects(){ | |
echo "<script>jQuery( function($){ $( '.jmfe-select-field' ).select2(); });</script>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment