• 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/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author eventualo

    (@eventualo)

    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

    (@atomiktd)

    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

    (@eventualo)

    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

    (@atomiktd)

    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

    (@eventualo)

    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

    (@atomiktd)

    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.