Settings API: enhance multiselect fileds
Add optional "select all"/"select none" buttons to multiselect fields, similarly to what already exists for the country field.
This commit is contained in:
parent
ea7b0adcc7
commit
7bb99af123
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue