Skip to content

Instantly share code, notes, and snippets.

@andreilupu
Created January 25, 2017 13:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreilupu/2ed88a589ece14a8a8afdb1170db9e43 to your computer and use it in GitHub Desktop.
Save andreilupu/2ed88a589ece14a8a8afdb1170db9e43 to your computer and use it in GitHub Desktop.
Gridable Attributes
<?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