@@ 89-102 (lines=14) @@ | ||
86 | * |
|
87 | * @param int $post_id ID of the post against which save() is ran |
|
88 | **/ |
|
89 | public function save( $post_id ) { |
|
90 | // Unhook action to garantee single save |
|
91 | remove_action( 'save_post', array( $this, '_save' ) ); |
|
92 | ||
93 | $this->set_post_id( $post_id ); |
|
94 | ||
95 | foreach ( $this->fields as $field ) { |
|
96 | $field->set_value_from_input(); |
|
97 | $field->save(); |
|
98 | } |
|
99 | ||
100 | do_action( 'carbon_after_save_custom_fields', $post_id ); |
|
101 | do_action( 'carbon_after_save_post_meta', $post_id ); |
|
102 | } |
|
103 | ||
104 | /** |
|
105 | * Perform checks whether the current save() request is valid |
@@ 69-81 (lines=13) @@ | ||
66 | * |
|
67 | * @param int $user_id ID of the user against which save() is ran |
|
68 | **/ |
|
69 | public function save( $user_id ) { |
|
70 | // Unhook action to garantee single save |
|
71 | remove_action( 'profile_update', array( $this, '_save' ) ); |
|
72 | ||
73 | $this->set_user_id( $user_id ); |
|
74 | ||
75 | foreach ( $this->fields as $field ) { |
|
76 | $field->set_value_from_input(); |
|
77 | $field->save(); |
|
78 | } |
|
79 | ||
80 | do_action( 'carbon_after_save_user_meta', $user_id ); |
|
81 | } |
|
82 | ||
83 | /** |
|
84 | * Perform checks whether the container should be attached during the current request |