Skip to content

Instantly share code, notes, and snippets.

@A5hleyRich
Last active September 11, 2015 19:23
Show Gist options
  • Save A5hleyRich/87d446a3ea9f577fc9ce to your computer and use it in GitHub Desktop.
Save A5hleyRich/87d446a3ea9f577fc9ce to your computer and use it in GitHub Desktop.
Delightful Downloads Custom Buttons
<?php
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' );
<?php
$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'
)
);
<?php
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' );
<?php
function dedo_custom_button( $buttons ) {
unset( $buttons['red'] );
unset( $buttons['yellow'] );
return $buttons;
}
add_filter( 'dedo_get_buttons', 'dedo_custom_button' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment