/**
  * When the post is saved, save a single custom data contained in the meta box.
  *
  * @since 0.1.0
  * @param int $post_id The ID of the post being saved.
  * @param array $element The element structure.
  * @param string|array $element_value The element value.
  */
 private function _save_single_field($post_id, $element, $value)
 {
     /* Escaping user-inserted slashes. */
     $value = str_replace('\\', '\\\\', $value);
     /* Sanitizing the field value. */
     $value = Ev_Field::sanitize($element, $value);
     update_post_meta($post_id, $element['handle'], $value);
 }
Пример #2
0
 /**
  * When the page or tab is saved, save a single custom option contained in the page or tab.
  *
  * @since 0.1.0
  * @param array $element The element structure.
  * @param string|array $element_value The element value.
  */
 protected function _save_single_field($element, $value)
 {
     $value = Ev_Field::sanitize($element, $value);
     ev_update_option($element['handle'], $value);
 }