Title: Integrate Jetengine Checkboxes
Last modified: November 11, 2019

---

# Integrate Jetengine Checkboxes

 *  Resolved [ekaboom](https://wordpress.org/support/users/ekaboom/)
 * (@ekaboom)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/)
 * So I’m struggling getting the JetEngine custom field checkboxes to integrate 
   with your schema plugin but keep running around in circles and can’t seem to 
   figure it out.
 * I may be doing it all wrong.
 * When I asked them how their checkboxes work different from other custom fields,
   they sent me this:
 * [https://prnt.sc/pvbsht](https://prnt.sc/pvbsht)
 * I’ve been working to try to get this to integrate with your plugin as you described
   here:
 *     ```
       	$paymentAcceptedValues = array_filter([
           get_post_meta($postId, 'biz-pay-cash', true ),
           get_post_meta($postId, 'biz-pay-check', true),
           get_post_meta($postId, 'biz-pay-credit', true),
           get_post_meta($postId, 'biz-pay-invoice', true),
           get_post_meta($postId, 'biz-pay-paypal', true),
       	]);
           $schema['paymentAccepted'] = implode(', ', $paymentAcceptedValues);
       ```
   
 * But I can’t seem to get it to work.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119634)
 * Add this:
 *     ```
       glsr_log()->debug(get_post_meta($postId, 'biz-pay-cash', true));
       ```
   
 * Then paste here what it shows in the plugin “Tools > Console” page (then remove
   the line).
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119722)
 * Something like this should work:
 *     ```
       $checkboxMetaKeys = [
           'biz-pay-cash',
           'biz-pay-check',
           'biz-pay-credit',
           'biz-pay-invoice',
           'biz-pay-paypal',
       ];
   
       $paymentAcceptedValues = [];
   
       foreach ($checkboxMetaKeys as $metaKey) {
           // get the meta value
           $value = get_post_meta($postId, $metaKey, true);
           // make sure we are dealing with an array
           if (!is_array($value)) {
               $paymentAcceptedValues[] = $value;
               continue;
           }
           // remove any keys that do not have "true" as the value
           $values = array_filter($value, 'wp_validate_boolean');
           // create a new array with only the array keys as values
           $values = array_keys($values);
           // merge these values with the others
           $paymentAcceptedValues = array_merge($paymentAcceptedValues, $values);
       }
   
       $schema['paymentAccepted'] = implode(', ', array_unique($paymentAcceptedValues));
       ```
   
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119730)
 * Of course, you could also do this:
 *     ```
       if (function_exists('jet_engine_custom_cb_render_checkbox')) {
           $paymentAcceptedValues = array_filter([
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-cash'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-check'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-credit'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-invoice'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-paypal'),
           ]);
           $schema['paymentAccepted'] = implode(', ', $paymentAcceptedValues);
       }
       ```
   
 * …unless the meta_key is actually `biz-pay` for all, in which case you would simply
   do this:
 *     ```
       if (function_exists('jet_engine_custom_cb_render_checkbox')) {
           $schema['paymentAccepted'] = jet_engine_custom_cb_render_checkbox($postId, 'biz-pay');
       }
       ```
   
    -  This reply was modified 6 years, 6 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).
 *  Thread Starter [ekaboom](https://wordpress.org/support/users/ekaboom/)
 * (@ekaboom)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119807)
 * That worked!
 *     ```
       if (function_exists('jet_engine_custom_cb_render_checkbox')) {
           $paymentAcceptedValues = array_filter([
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-cash'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-check'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-credit'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-invoice'),
               jet_engine_custom_cb_render_checkbox($postId, 'biz-pay-paypal'),
           ]);
           $schema['paymentAccepted'] = implode(', ', $paymentAcceptedValues);
       }
       ```
   
 * Thanks so much. I left you a review here:
 * [https://wordpress.org/support/topic/amazingly-perfect-plugin-and-support](https://wordpress.org/support/topic/amazingly-perfect-plugin-and-support)
 * Going to send some soda money too!
 * Thanks again!
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119825)
 * Thanks! Happy we figured it out.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Integrate Jetengine Checkboxes’ is closed to new replies.

 * ![](https://ps.w.org/site-reviews/assets/icon-256x256.gif?rev=3307009)
 * [Site Reviews](https://wordpress.org/plugins/site-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/site-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/site-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/site-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/site-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/site-reviews/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/integrate-jetengine-checkboxes/#post-12119825)
 * Status: resolved