Support

Account

Forum Replies Created

  • Solved it by modifying the plugin to enqueue only on that certain page.

  • Ok I was wrong – it IS a plugin that stops the MAP field and other JS from working.
    In fact, ANY other Map plugin conflicts with ACF.

    Either the map created from the plugin won’t render, or the plugin breaks ACF’s JS.

    The Plugin (WP GPX Maps) loads a script in its plugin file correctly with wp_enqueue_script( 'googlemaps', '//maps.googleapis.com/maps/api/js?sensor=false', null, null);
    which causes the conflict.

    Any attempt to load this JS only on certain pages etc fails (function.php with add_action etc).

    I am not sure wether this is a problem with the plugin or with ACF, any help is appreciated.

  • Edit: This happens also on the Backend (Admin)… On custom post types with ACF map field, JS is broken.

  • You can add this to your functions.php to restrict shown media to the items owned by the current user:

    add_action('pre_get_posts','my_restrict_media_library');
    function my_restrict_media_library( $wp_query_obj ) {
    
    global $current_user, $pagenow;
    
    if( !is_a( $current_user, 'WP_User') )
    
    return;
    
    if( 'admin-ajax.php' != $pagenow || $_REQUEST['action'] != 'query-attachments' )
    
    return;
    
    if( !current_user_can('edit_files') )
    
    $wp_query_obj->set('author', $current_user->ID );
    
    return;
    
    }
    
Viewing 4 posts - 1 through 4 (of 4 total)