RestroPress

⌘K
  1. Home
  2. Docs
  3. RestroPress
  4. Developer Docs
  5. Filters
  6. rpress_metabox_save_

rpress_metabox_save_

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' );

How can we help?