• I’ve already seen this page 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’

    https://www.ads-software.com/plugins/super-cpt/

Viewing 1 replies (of 1 total)
  • Plugin Author Matthew Boynes

    (@mboynes)

    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.