rpress_metabox_save_

Author: RestroPress 22 views

rpress_metabox_save_ filter is applied to get custom fields to save for the metabox.The filter includes one parameter which return the value of the field.
apply_filters( ‘rpress_metabox_save_’ . $field, $value );

The sample below shows an example of how you could modify it:

function rpress_sanitize_bundled_products_save( $products = array() ) {

            global $post;

            $self = array_search( $post->ID, $products );

            if( $self !== false )
            unset( $products[ $self ] );

        return array_values( array_unique( $products ) );
}
add_filter( 'rpress_metabox_save__rpress_bundled_products', 'rpress_sanitize_bundled_products_save' );