Filter Dropdown not displaying
-
I’m trying to add a filter to a member directory but it’s not displaying. I believe it’s a select2.js conflict but I can’t get it to show up. It always populates as hidden. I have users with data set on this field and all properties are set correctly. How can I get a dropdown to display within a member directory filter?
The page I need help with: [log in to see the link]
-
Hello @jessepschultz
Can you please share a screenshot of your filter settings area?
I tried the select2 conflicts script, but no luck. I’ve also got a dropdown to appear on the edit profile page by this script, but it still doesn’t show on filtering. Screen shot link is here
add_filter( 'um_extend_field_classes', 'um_121520_extend_field_classes', 999999, 3); function um_121520_extend_field_classes( $classes, $key, $data ){ if( $key == 'primarymedium' ){ $classes = str_replace("um-s1", "", $classes); } return $classes; }Did you use only this code snippet and not the bigger one:
add_filter( 'um_dequeue_select2_scripts', '__return_true' );Yes I used both snippets of code.
Look at the HTML Source file if you have an id for the other select2 js file.
The UM id isselect2-jsSorry I replied to another topic. I have updated my script to only use this snippet, still not showing up.
add_filter( 'um_dequeue_select2_scripts', '__return_true' );Look at the HTML source file if you can find the select2 js files.
You will find these lines by the end of the HTML source.The UM js file has an id
select2-jsand what is the id of the conflicting js file?-
This reply was modified 3 years, 6 months ago by
missveronica.
-
This reply was modified 3 years, 6 months ago by
missveronica.
If I check my html source there’s no other select2 js file loading. Only css files. You can check the source in my link above and see for yourself. The other css is coming from revslider plugin but no js file loading other than from UM.
The other thread with a user with similar select2 issue and this code snippet solved the issue. The Theme added the select2 js file. A Theme from same company as your Theme.
You can try the code snippet instead of the first script.
add_filter( 'um_dequeue_select2_scripts', 'um_dequeue_select2_scripts_fix', 10, 1 ); function um_dequeue_select2_scripts_fix( $bool ) { wp_dequeue_style( 'select2' ); wp_deregister_style( 'select2' ); wp_dequeue_script( 'select2.min.js'); wp_deregister_script('select2.min.js'); wp_dequeue_style( 'select2-css' ); wp_deregister_style( 'select2-css' ); wp_dequeue_script( 'select2.min.js-js'); wp_deregister_script('select2.min.js-js'); return $bool; }Hello, still no luck when adding this latest script to my functions file. Appreciate the help…any other ideas?
Yes one more attempt, you can try this code snippet which will deactivate
the UM select2 JavaScript and style sheet:add_action( 'wp_print_styles', 'um_dequeue_my_select2_style' ); add_action( 'wp_print_scripts', 'um_dequeue_my_select2_script' ); function um_dequeue_my_select2_style() { wp_dequeue_style( 'select2' ); wp_deregister_style( 'select2' ); } function um_dequeue_my_select2_script() { wp_dequeue_script( 'select2' ); wp_deregister_script( 'select2' ); }Sorry, use this code snippet instead which is the recommended solution by WP to dequeue scripts and styles.
add_action( 'wp_enqueue_scripts', 'um_dequeue_my_select2_scripts', 999 ); function um_dequeue_my_select2_scripts() { wp_dequeue_script( 'select2' ); wp_deregister_script( 'select2' ); wp_dequeue_style( 'select2' ); wp_deregister_style( 'select2' ); }Still no luck. This latest update causes the member grid not to load at all…and the dropdown is still hidden.
In your case there is not a conflict with another loaded select2 script.
Have you done a Plugin/Theme conflict test described in this guide:
https://docs.ultimatemember.com/article/96-how-to-do-a-plugin-theme-conflict-test
-
This reply was modified 3 years, 6 months ago by
The topic ‘Filter Dropdown not displaying’ is closed to new replies.