Skip to content

Instantly share code, notes, and snippets.

@hirejordansmith
Created March 3, 2017 12:31
Show Gist options
  • Save hirejordansmith/b145df06248f03db01e7213f399f5bff to your computer and use it in GitHub Desktop.
Save hirejordansmith/b145df06248f03db01e7213f399f5bff to your computer and use it in GitHub Desktop.
Customizing the Multi-File Merge Tag
<?php
#Usage
gw_multi_file_merge_tag()->register_settings( array(
'form_id' => 1,
'markup' => array(
array(
'file_types' => array( 'jpg', 'jpeg', 'png', 'gif' ),
'markup' => '<div class="gw-file gw-image gw-{ext}"><a href="{url}"><img src="{url}"></a></div>'
),
array(
'file_types' => array( 'mp4', 'ogg', 'webm' ),
'markup' => '<video width="320" height="240" controls>
<source src="{url}" type="video/{ext}">
Your browser does not support the video tag.
</video>'
)
)
) );
.gw-file {
float: left;
margin: 0 5px 20px;
margin: 0 1% 20px;
width: 31.3333%;
}
.gw-file a {
text-transform: uppercase;
font-size: 11px;
}
.gw-file a:first-child {
display: block;
min-height: 120px;
max-height: 120px;
overflow: hidden;
border-radius: 3px;
background-color: #eee;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment