Title: Filters example
Last modified: August 21, 2016

---

# Filters example

 *  Resolved [Pablo Pacheco](https://wordpress.org/support/users/karzin/)
 * (@karzin)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/filters-example/)
 * I’ve already seen [this page](https://github.com/mboynes/super-cpt/wiki/Actions-and-Filters)
   about your filters and actions but there aren’t any examples. Could you give 
   me any directions on how to use this filter (scpt_plugin_{$this->type}_meta_save_{
   $field}) for example?
 * I’m trying to use like this:
 *     ```
       $superCustomCPT = new Super_Custom_Post_Type('mycustomcpt');
       $superProductCPT = new Super_Custom_Post_Type('product');
               $superProductCPT->add_meta_box(array(
                   'id' => 'attribute_groups',
                   'title' => 'My title',
                   'fields' => array(
                       'prod_attribute_groups' => array( 'type' => 'checkbox', 'label' => false, 'data' => 'mycustomcpt', 'multiple' => 'multiple' )
                   )
               ));
   
       function test($test){
                   _log('asdasd');
                   _log(print_r($test,true));
               }
               add_filter('scpt_plugin_product_meta_save_attribute_groups','test');
       ```
   
 * But this error is showing up: Undefined index: ‘attribute_groups’
 * [http://wordpress.org/plugins/super-cpt/](http://wordpress.org/plugins/super-cpt/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Matthew Boynes](https://wordpress.org/support/users/mboynes/)
 * (@mboynes)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/filters-example/#post-4158687)
 * Hi Karzin,
    It’s the field name, not the meta box id. So in your case, `prod_attribute_groups`.
 * Examples of this is a good idea, I’ll add it to my list to add to the wiki.
 * Thanks,
    Matt

Viewing 1 replies (of 1 total)

The topic ‘Filters example’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/super-cpt.svg)
 * [SuperCPT](https://wordpress.org/plugins/super-cpt/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/super-cpt/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/super-cpt/)
 * [Active Topics](https://wordpress.org/support/plugin/super-cpt/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/super-cpt/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/super-cpt/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Matthew Boynes](https://wordpress.org/support/users/mboynes/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/filters-example/#post-4158687)
 * Status: resolved