attachment url dynamic tag for layout builder

<?php

/** attachemnt url dynamic tag
 ** for use when results are media type posts
 ** IMPORTANT: does not check that post type is valid attachment type **/

add_filter( 'facetwp_builder_dynamic_tags', function( $tags, $params ) {
    $tags['attachment:url'] = esc_url( wp_get_attachment_url( $params['post']->ID ) );
    return $tags;
}, 10, 2 );