Support

Account

Home Forums General Issues A conflict to be aware of (won't affect many)

A conflict to be aware of (won't affect many)

  • Something I came across when using a child theme of Automattic’s Toolbox theme (v1.4 – latest at time of writing).

    The last function in the functions.php file (toolbox_enhanced_image_navigation()) prevents ACF’s file upload (probably also the image upload) from working properly. I haven’t tested all permutations of the upload field, but in at least one configuration, that function is 100% responsible for the issue.

    The toolbox filter appends ‘#main’ to the URL for the attachment.

    The solution is to add the following to your child-theme’s funtions.php file:

    #==============================================================================
    # FIX THE FILTER PREVENTING ACF UPLOADS
    #------------------------------------------------------------------------------
    function removeToolboxFilters()
    {
        remove_filter( 'attachment_link', 'toolbox_enhanced_image_navigation' );
    }
    add_action('after_setup_theme', 'removeToolboxFilters');

    By the way, ACF may be slightly at fault here (though maybe not – I don’t know enough about WP’s inner workings). I only say that because the toolbox function only triggers if the function wp_attachment_is_image() returns true, but the conflict affects uploading any type of file.

Viewing 1 post (of 1 total)

The topic ‘A conflict to be aware of (won't affect many)’ is closed to new replies.