Title: [plugin: magic fields] Sorting By Custom Fields with Magic Fields checkbox
Last modified: August 19, 2016

---

# [plugin: magic fields] Sorting By Custom Fields with Magic Fields checkbox

 *  Resolved [nadine00](https://wordpress.org/support/users/nadine00/)
 * (@nadine00)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-magic-fields-sorting-by-custom-fields-with-magic-fields-checkbox/)
 * Hi,
 * I am trying to sort posts by a custom field, using the plugin Magic Fields. The
   problem? When I use the option of a checkbox, I can not get my posts to sort.
   It works fine if its a drop down, or another form of single info using this method:
 *     ```
       <?php $making_args = array(
               'cat' => 22,
               'meta_key' => 'lesson-type', //this is the magic field variable
               'meta_value' => 'Self Study', //this is the value it looks for
               'posts_per_page' => 10,
               'offset' => 0,
               );?>
       ```
   
 * But does not work if the input is a check box because apparently the plugin writes
   an array to the field.
 * From the google group (what is in the database):
    `post_meta save a:2:{i:0;s:
   3:"dos";i:1;s:6:"cuatro";}`
 * I am looking for suggestions on how to parse that array. I’m asking both here
   and in the google group.
 * Thanks!
 * Nadine

The topic ‘[plugin: magic fields] Sorting By Custom Fields with Magic Fields checkbox’
is closed to new replies.

## Tags

 * [arrays](https://wordpress.org/support/topic-tag/arrays/)
 * [checkboxes](https://wordpress.org/support/topic-tag/checkboxes/)

 * 0 replies
 * 1 participant
 * Last reply from: [nadine00](https://wordpress.org/support/users/nadine00/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-magic-fields-sorting-by-custom-fields-with-magic-fields-checkbox/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
