• Once checked, checkboxes are not saved and they required to be checked each time I want to add or remove any category from front page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author binarymoon

    (@binarymoon)

    Hi there – sorry to hear this. It’s not a problem I have seen before.

    I imagine there is a conflict with a plugin/ theme.

    Are you able to check the browser console to see if there’s any JavaScript errors?

    Also disabling all plugins apart from Front PAge Categories and seeing if the problem persists would be helpful. If that fixes it then re-enabling the pligins one by one will help us find what is causing the issue.

    Thanks – Ben

    Thread Starter zakir786lrk

    (@zakir786lrk)

    Hi dear, I deactivated all themes and plugins except front page categories but it still doesn’t work.

    When I select some categories to be shown on my homepage by visiting customizer and publish setting it works fine but when I want to select another category, the customizer setting unchecks all earlier checked checkboxes and I have to select each category again. I have plenty of categories in my website so it causes great trouble.

    Hi,

    in “class.fpc-category-list.php”, line 73, you pass the argument “strict” to in_array, but you compare an int to a string.

    Changing

    <input type="checkbox" class="fpc-category" value="<?php echo (int) $category->term_id; ?>" <?php checked( in_array( $category->term_id, $values, true ) ); ?> />

    to

    <input type="checkbox" class="fpc-category" value="<?php echo (int) $category->term_id; ?>" <?php checked( in_array( $category->term_id, $values, false ) ); ?> />

    categories are correctly checked when you return to the settings page.

    Tested with WP 5.9.1, PHP 7.4

    Plugin Author binarymoon

    (@binarymoon)

    Hi there – thanks a lot for the report. The strict in_array check is a WP coding standards thing. I must have missed the error when making the change to the in_array code to make it follow standards.

    I have added some code that makes sure the array of categories is filled with ints rather than strings. This seems to solve the issue.

    Thanks again – Ben

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘All checkboxes are unchecked after visiting customizer next time’ is closed to new replies.