Skip to content

Instantly share code, notes, and snippets.

@A5hleyRich
Last active August 29, 2015 14:17
Show Gist options
  • Save A5hleyRich/d112894641aa96159f87 to your computer and use it in GitHub Desktop.
Save A5hleyRich/d112894641aa96159f87 to your computer and use it in GitHub Desktop.
Delightful Download Docs
$buttons = array(
'black' => array(
'name' => __( 'Black', 'delightful-downloads' ),
'class' => 'button-black'
),
'blue' => array(
'name' => __( 'Blue', 'delightful-downloads' ),
'class' => 'button-blue'
),
'grey' => array(
'name' => __( 'Grey', 'delightful-downloads' ),
'class' => 'button-grey'
),
'green' => array(
'name' => __( 'Green', 'delightful-downloads' ),
'class' => 'button-green'
),
'purple' => array(
'name' => __( 'Purple', 'delightful-downloads' ),
'class' => 'button-purple'
),
'red' => array(
'name' => __( 'Red', 'delightful-downloads' ),
'class' => 'button-red'
),
'yellow' => array(
'name' => __( 'Yellow', 'delightful-downloads' ),
'class' => 'button-yellow'
)
);
function dedo_custom_button( $buttons ) {
$buttons['custom'] = array(
'name' => __( 'Custom Button', 'delightful-downloads' ),
'class' => 'button-custom'
);
return $buttons;
}
add_filter( 'dedo_get_buttons', 'dedo_custom_button' );
function dedo_custom_button( $buttons ) {
$custom_buttons['bright_pink'] = array(
'name' => __( 'Bright Pink', 'delightful-downloads' ),
'class' => 'button-bright-pink'
);
return $custom_buttons;
}
add_filter( 'dedo_get_buttons', 'dedo_custom_button' );
function dedo_custom_button( $buttons ) {
unset( $buttons['red'] );
unset( $buttons['yellow'] );
return $buttons;
}
add_filter( 'dedo_get_buttons', 'dedo_custom_button' );
$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>'
)
);
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' );
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' );
function custom_list( $lists ) {
unset( $lists['title_filesize'] );
return $lists;
}
add_filter( 'dedo_get_lists', 'custom_list' );
$styles = array(
'button' => array(
'name' => __( 'Button', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%text%" rel="nofollow" class="%class%">%text%</a>'
),
'link' => array(
'name' => __( 'Link', 'delightful-downloads' ),
'format' => '<a href="%url%" title="%text%" rel="nofollow" class="%class%">%text%</a>'
),
'plain_text'=> array(
'name' => __( 'Plain Text', 'delightful-downloads' ),
'format' => '%url%'
)
);
function dedo_custom_output( $styles ) {
$styles['icon_link'] = array(
'name' => __( 'Icon Link', 'delightful-downloads' ),
'format' => '<div class="download_container">
<i class="fa fa-download"></i>
<a href="%url%" title="%title%" rel="nofollow">%title%</a>
</div>'
);
return $styles;
}
add_filter( 'dedo_get_styles', 'dedo_custom_output' );
function dedo_custom_output( $styles ) {
$new_styles['icon_link'] = array(
'name' => __( 'Icon Link', 'delightful-downloads' ),
'format' => '<div class="download_container">
<i class="fa fa-download"></i>
<a href="%url%" title="%title%" rel="nofollow">%title%</a>
</div>'
);
return $new_styles;
}
add_filter( 'dedo_get_styles', 'dedo_custom_output' );
function dedo_custom_output( $styles ) {
unset( $styles['plain_text'] );
return $styles;
}
add_filter( 'dedo_get_styles', 'dedo_custom_output' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment