Skip to content

Instantly share code, notes, and snippets.

@A5hleyRich
Last active September 11, 2015 19:29
Show Gist options
  • Save A5hleyRich/dbbaebf7c9d8e69d43c8 to your computer and use it in GitHub Desktop.
Save A5hleyRich/dbbaebf7c9d8e69d43c8 to your computer and use it in GitHub Desktop.
Delightful Downloads Custom Outputs
<?php
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' );
<?php
$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%'
)
);
<?php
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' );
<?php
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