043_tf_hermann_multicheck-option-and-select-all-parameterWhat do you do with checkboxes, amounting to more than 15, and you have to check each and every one of them? Usually, you need something we call “Check all” or “Select all”, right? Even WordPress itself implements it on forms with multiple checkboxes.

Now, Titan Framework has this for all multicheck options too, and it can be enabled.

Let me tell you a secret: I pushed for this to be implemented.

Right now, it’s available in different tutorials:

$panel->createOption( array(
'name' => 'Multicheck Post-Types',
'id' => 'my_multicheck_post_types_option',
'type' => 'multicheck-post-types',
'desc' => 'Check a post-type',
'select_all' => true,
) );

A Select All checkbox will appear above the printed checkbox options. Checking this Select All checkbox will mark every entries below it checked, even if there’s an existing entry already checked. Unchecking Select All, conversely, will uncheck all the boxes below it.

Values accepted are true, a string (to customize the caption of the selectall checkbox) or false to disable this. By default, the value is true.

What’s in it for developers?

Well, not really developers, but more for the end-users. If it’s any consolation, you will impart a better user experience by making the multicheck settings more convenient in terms of user experience.

The feature is more noticeable though in situations where multicheck lists can amount to more than 30.

And as mentioned above, the caption for the Select All checkbox can be customized. There is no adverse effects or changes to the returned value though, so even if you check all values through the Select All checkbox, the returned values will still be the values belonging to the enumerated checkbox entries.

Case usage

Still not convinced? Here are some sample coding situations you might find yourself into:

  1. I want to select everything but they are 40 entries! I don’t have the patience to check them all! (The answer to this should be pretty obvious). What if I want to select everything except for a couple of entries? Checking each and every entry is so cumbersome. Answer? Select all then uncheck ones you don’t need.
    3. I have everything selected in a previous session, but new entries appear, and they’re quite numerous, but I want them all selected! Answer? Toggle between Select all until every entry is checked.
  2. What if I want to select everything except for a couple of entries? Checking each and every entry is so cumbersome. Answer? Select all then uncheck ones you don’t need.
  3. I have everything selected in a previous session, but new entries appear, and they’re quite numerous, but I want them all selected! Answer? Toggle between Select all until every entry is checked.The inverse of #3; I don’t want anything checked, but the checked entries are spread around the printed options! Answer? Toggle between Select all until every entry is deselected.
  4. The inverse of #3; I don’t want anything checked, but the checked entries are spread around the printed options! Answer? Toggle between Select all until every entry is deselected.
  5. What if I want to select everything except for a couple of entries? Checking each and every entry is so cumbersome. Answer? Select all then uncheck ones you don’t need.I have everything selected in a previous session, but new entries appear, and they’re quite numerous, but I want them all selected! Answer? Toggle between Select all until every entry is checked.
    4. The inverse of #3; I don’t want anything checked, but the checked entries are spread around the printed options! Answer? Toggle between Select all until every entry is deselected.
  6. I have everything selected in a previous session, but new entries appear, and they’re quite numerous, but I want them all selected! Answer? Toggle between Select all until every entry is checked.The inverse of #3; I don’t want anything checked, but the checked entries are spread around the printed options! Answer? Toggle between Select all until every entry is deselected.
  7. The inverse of #3: I don’t want anything checked, but the checked entries are spread around the printed options! Answer? Toggle between Select all until every entry is deselected.

Leave a Reply