Merge pull request #10079 from woothemes/add/select-all-buttons-multiselect-field

Settings API: add optional "select all"/"select none" buttons to multiselect fields
This commit is contained in:
Claudio Sanches 2016-01-21 19:30:12 -02:00
commit f4fddf2252
1 changed files with 4 additions and 0 deletions

View File

@ -666,6 +666,7 @@ abstract class WC_Settings_API {
'desc_tip' => false,
'description' => '',
'custom_attributes' => array(),
'allbuttons' => false,
'options' => array()
);
@ -688,6 +689,9 @@ abstract class WC_Settings_API {
<?php endforeach; ?>
</select>
<?php echo $this->get_description_html( $data ); ?>
<?php if ( $data['allbuttons'] ) : ?>
<br/><a class="select_all button" href="#"><?php _e( 'Select all', 'woocommerce' ); ?></a> <a class="select_none button" href="#"><?php _e( 'Select none', 'woocommerce' ); ?></a>
<?php endif; ?>
</fieldset>
</td>
</tr>