Created
January 25, 2017 13:18
-
-
Save andreilupu/2ed88a589ece14a8a8afdb1170db9e43 to your computer and use it in GitHub Desktop.
Gridable Attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gridable_row_options', function ( $options ) { | |
$options['bg_color'] = array( | |
'type' => 'color', | |
'label' => 'Row Background Color', | |
'default' => 'transparent' | |
); | |
$options['stretch'] = array( | |
'type' => 'checkbox', | |
'label' => 'Is stretched?', | |
'default' => 0 | |
); | |
$options['title'] = array( | |
'label' => 'Maybe a row title', | |
); | |
return $options; | |
}); | |
add_filter( 'gridable_column_options', function ( $options ) { | |
$options['bg_color'] = array( | |
'type' => 'color', | |
'label' => 'Column Background Color', | |
'default' => 'transparent' | |
); | |
$options['custom_checked_attribute'] = array( | |
'type' => 'checkbox', | |
'label' => 'On or off?', | |
'default' => 0 | |
); | |
$options['selector'] = array( | |
'label' => 'A Select attribute', | |
'type' => 'select', | |
'options' => array( | |
'option1' => 'First Option', | |
'option2' => 'Second', | |
'option3' => 'Enough' | |
), | |
'default' => 'option1' | |
); | |
return $options; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment