Last active
February 11, 2026 14:15
-
-
Save yuriinalivaiko/5199b87a3deac34aa069d49bb727343b to your computer and use it in GitHub Desktop.
Code snippets for the "User Locations" extension
This file contains hidden or 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
| /* | |
| * Make the location search line and the general search line full-width | |
| * Example: https://ibb.co/0jH0FZ9C | |
| */ | |
| .um-directory .um-member-directory-header .um-member-directory-map-controls div.um-member-directory-map-controls-half, | |
| .um-directory .um-member-directory-header .um-member-directory-header-row div.um-member-directory-search-line { | |
| width: 100%; | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Defer scripts of the "Ultimate Member - User Locations" extension. | |
| * | |
| * @link https://developer.wordpress.org/reference/classes/wp_scripts/add_data/ | |
| * @global WP_Scripts $wp_scripts | |
| */ | |
| function um_user_locations_alter_scripts() { | |
| global $wp_scripts; | |
| if ( wp_script_is( 'um-maps' ) ) { | |
| $wp_scripts->add_data( 'um-maps', 'strategy', 'defer' ); | |
| } | |
| if ( wp_script_is( 'um-map-shortcode' ) ) { | |
| $wp_scripts->add_data( 'um-map-shortcode', 'strategy', 'defer' ); | |
| } | |
| if ( wp_script_is( 'um-user-location-field' ) ) { | |
| $wp_scripts->add_data( 'um-user-location-field', 'strategy', 'defer' ); | |
| } | |
| } | |
| add_action( 'wp_print_scripts', 'um_user_locations_alter_scripts', 7 ); | |
| add_action( 'wp_print_footer_scripts', 'um_user_locations_alter_scripts', 7 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment