Title: feature request: Automatic list selection for widget
Last modified: August 30, 2016

---

# feature request: Automatic list selection for widget

 *  [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/)
 * Hi,
 * It was kind of feature request before but still it’s not implemented.
 * The idea is, that when there is only one list to be displayed for subscription,
   it is automatically “ticked”.
 * I can achieve it by changing line 33 in alo-easymail-widget.php and replace
 * `$checkbox_js = "";`
 * with
 * `$checkbox_js = "checked";`
 * but it is not permanent and needs to be changed again after plugin update.
 * It would be nice to have an option in plugin settings to automatically “tick”
   such lonely list or just automatic “tick” without option.
 * It doesn’t look like difficult change.
 * Is it possible with the next update?
 * [https://wordpress.org/plugins/alo-easymail/](https://wordpress.org/plugins/alo-easymail/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [eventualo](https://wordpress.org/support/users/eventualo/)
 * (@eventualo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291852)
 * Hi Tom, I understand your point.
    For the moment you can add the following code
   in your theme _functions.php_ or in a php file inside _wp-content/mu-plugins_:
 *     ```
       function my_easymail_check_lists() { ?>
       <script type="text/javascript">
       	jQuery(document).ready(function( $ ){
       		$('.alo_easymail_reg_list input[type=checkbox], .alo_easymail_lists_table input[type=checkbox]').prop('checked', true);
       	});
       </script>
       <?php }
       add_action( 'wp_footer', 'my_easymail_check_lists' );
       add_action( 'login_footer', 'my_easymail_check_lists' );
   
       function my_easymail_login_enqueue_scripts() {
       	wp_enqueue_script('jquery');
       }
       add_action( 'login_enqueue_scripts', 'my_easymail_login_enqueue_scripts' );
       ```
   
 *  Thread Starter [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291857)
 * Thank you eventualo for your solution but it doesn’t work for me. Maybe I did
   sth wrong?
 * I created functions.php in my child-theme directory and put your code inside.
 * As a result I received and error message:
 *     ```
       Parse error: syntax error, unexpected '}' in /home/teedee/domains/wpoznaniu.cf/public_html/domdzwieku/wp-content/themes/megalith-child/functions.php on line 6
       ```
   
 * How to fix it?
 *  Plugin Author [eventualo](https://wordpress.org/support/users/eventualo/)
 * (@eventualo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291956)
 * What code is there at line 6 of your file?
    Can you paste here the first 20-30
   lines of code of your functions.php?
 *  Thread Starter [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291964)
 * My functions.php only contains the code you supplied so line 6 is
 *     ```
       </script> <?php }
       ```
   
 * I tried to debug it and even when I reduce first 6 lines of code to
 *     ```
       function my_easymail_check_lists() { ?> <?php }
       ```
   
 * it still returns an error
 *     ```
       Parse error: syntax error, unexpected '}' in /home/xxx/wp-content/themes/child/functions.php on line 1
       ```
   
 * it should be legitimate empty function shouldn’t it?
 *  Plugin Author [eventualo](https://wordpress.org/support/users/eventualo/)
 * (@eventualo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291980)
 * Do you put the opening php (`<?php`) tag before the code?
    Then, I updated the
   code adding an enqueue to be sure to load jquery on every page. So the full code
   should be:
 *     ```
       <?php
       function my_easymail_check_lists() { ?>
       <script type="text/javascript">
       	jQuery(document).ready(function( $ ){
       		$('.alo_easymail_reg_list input[type=checkbox], .alo_easymail_lists_table input[type=checkbox]').prop('checked', true);
       	});
       </script>
       <?php }
       add_action( 'wp_footer', 'my_easymail_check_lists' );
       add_action( 'login_footer', 'my_easymail_check_lists' );
   
       function my_easymail_enqueue_scripts() {
       	wp_enqueue_script('jquery');
       }
       add_action( 'wp_enqueue_scripts', 'my_easymail_enqueue_scripts' );
       add_action( 'login_enqueue_scripts', 'my_easymail_enqueue_scripts' );
       ```
   
 *  Thread Starter [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291981)
 * It works!
 * Thank you very much eventualo.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘feature request: Automatic list selection for widget’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/alo-easymail_574f4b.svg)
 * [ALO EasyMail Newsletter](https://wordpress.org/plugins/alo-easymail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/alo-easymail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/alo-easymail/)
 * [Active Topics](https://wordpress.org/support/plugin/alo-easymail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/alo-easymail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/alo-easymail/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/atomiktd/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/feature-request-automatic-list-selection-for-widget/#post-6291981)
 * Status: not resolved