src/Forms/Fields/Types/IntegerType.php
public function metaboxSave($value, int $post_id)
    {
        $this->setValue($value);

        $previous = get_post_meta($post_id, $this->getName(), true);

        if (is_null($this->getValue()) || empty($this->getValue())) {
            delete_post_meta($post_id, $this->getName());
        } elseif (empty($previous)) {
            add_post_meta($post_id, $this->getName(), $this->getRawValue(), true);
        } else {
            update_post_meta($post_id, $this->getName(), $this->getRawValue(), $previous);
        }
    }
public function metaboxSave($value, int $post_id)
    {
        $this->setValue($value);

        $previous = get_post_meta($post_id, $this->getName(), true);

        if (is_null($this->getValue()) || empty($this->getValue())) {
            delete_post_meta($post_id, $this->getName());
        } elseif (empty($previous)) {
            add_post_meta($post_id, $this->getName(), $this->getRawValue(), true);
        } else {
            update_post_meta($post_id, $this->getName(), $this->getRawValue(), $previous);
        }
    }
public function metaboxSave ( $ value , int $ post_id ) { $ this -> setValue ( $ value ) ; $ previous = get_post_meta ( $ post_id , $ this -> getName ( ) , true ) ; if ( is_null ( $ this -> getValue ( ) ) || empty ( $ this -> getValue ( ) ) ) { delete_post_meta ( $ post_id , $ this -> getName ( ) ) ; } elseif ( empty ( $ previous ) ) { add_post_meta ( $ post_id , $ this -> getName ( ) , $ this -> getRawValue ( ) , true ) ; } else { update_post_meta ( $ post_id , $ this -> getName ( ) , $ this -> getRawValue ( ) , $ previous ) ; } }
Handle integer field post meta registration.

@param string $value
@param int    $post_id
Handle integer field post meta registration .