Skip to content

Instantly share code, notes, and snippets.

@A5hleyRich
Last active September 11, 2015 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A5hleyRich/ccbb933c1a62332b0f9c to your computer and use it in GitHub Desktop.
Save A5hleyRich/ccbb933c1a62332b0f9c to your computer and use it in GitHub Desktop.
Delightful Downloads Custom Lists
<?php
function custom_list( $lists ) {
$lists['icon_date'] = array(
'name' => 'Icon (Date)',
'format' => '<i class="fa fa-download"></i><a href="%url%" title="%title%" rel="nofollow">%title% - %date%</a>'
);
return $lists;
}
add_filter( 'dedo_get_lists', 'custom_list' );
<?php
$lists = array(
'title' => array(
'name' => __( 'Title', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%title%" rel="nofollow">%title%</a>'
),
'title_date' => array(
'name' => __( 'Title (Date)', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%title% (%date%)" rel="nofollow">%title% (%date%)</a>'
),
'title_count' => array(
'name' => __( 'Title (Count)', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%title% (Downloads: %count%)" rel="nofollow">%title% (Downloads: %count%)</a>'
),
'title_filesize' => array(
'name' => __( 'Title (Filesize)', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%title% (%filesize%)" rel="nofollow">%title% (%filesize%)</a>'
)
);
<?php
function custom_list( $lists ) {
$new_lists['icon_date'] = array(
'name' => 'Icon (Date)',
'format' => '<i class="fa fa-download"></i><a href="%url%" title="%title%" rel="nofollow">%title% - %date%</a>'
);
return $new_lists;
}
add_filter( 'dedo_get_lists', 'custom_list' );
<?php
function custom_list( $lists ) {
unset( $lists['title_filesize'] );
return $lists;
}
add_filter( 'dedo_get_lists', 'custom_list' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment