Exemplo n.º 1
0
 /**
  * @param int  $post_id
  * @param WP_Post $post
  */
 public function _action_save_post($post_id, $post)
 {
     if (!fw_is_real_post_save($post_id)) {
         return;
     }
     $old_values = (array) fw_get_db_post_option($post_id);
     $options_values = array_merge($old_values, fw_get_options_values_from_input(fw()->theme->get_post_options($post->post_type)));
     fw_set_db_post_option($post_id, null, $options_values);
     do_action('fw_save_post_options', $post_id, $post, $old_values);
 }
Exemplo n.º 2
0
 /**
  * @param int  $post_id
  * @param WP_Post $post
  */
 public function _action_save_post($post_id, $post)
 {
     if (!fw_is_real_post_save($post_id)) {
         return;
     }
     $options_values = array_merge((array) fw_get_db_post_option($post_id), fw_get_options_values_from_input(fw()->theme->get_post_options($post->post_type)));
     fw_set_db_post_option($post_id, null, $options_values);
     // find options that requested to be saved in separate meta
     foreach (fw_extract_only_options(fw()->theme->get_post_options($post->post_type)) as $option_id => $option) {
         if (isset($option['save-to-separate-meta']) && $option['save-to-separate-meta']) {
             // think of a better key name
             fw_update_post_meta($post_id, 'fw_option_' . $option_id, $options_values[$option_id]);
         }
     }
     do_action('fw_save_post_options', $post_id, $post, $options_values);
 }
 /**
  * @internal
  *
  * @param $post_id
  */
 public function _action_admin_on_save_event($post_id)
 {
     if (get_post_type($post_id) !== $this->parent->get_post_type_name() or !fw_is_real_post_save($post_id)) {
         return;
     }
     $this->_fw_remove_all_event_children_data($post_id);
     $this->_fw_insert_all_event_children_data($post_id);
 }