Home>Support>WP widget checkboxes do not save their value

WP widget checkboxes do not save their value

I have a custom WP widget with a select and several checkboxes.
Being added to column the widget select works fine – on saving it really saves select value;
But checkboxes lose their value.

I looked through some examples and I see that normally input name should be rendered as nested

widgets[c77][program_id]

But name attributes of my checkboxes are rendered as

widget-studyprogram_widget-c77-hide_image

I tried to get into the plugin code but it’s really hard to undestrand.

Widget code

P.S. My widget checkboxes works fine being used through native WP mechanisms like adding to sidebar.

Thank you.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 2 months ago Alex S
    Hi, I Work Here

    Hi Amorphine,

    Can you please clarify what is visible when you inspect the $_POST on form submission? Ideally, you should check when you’ve ticked a checkbox.

  2. 6 years, 2 months ago amorphine

    Hi Alex!
    Thanks for reply.

    I discovered the issue is up to the widget generator I used. It produces not really valid code so it turned out to be incompartible with the Page Builder (incorrect input name attributes, incorrect passing values between new/old instances while saving process).

    Sorry to waste your time. I tried to close the topic but I couldn’t.

    Thank you.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More