@@ 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 |
@@ 68-80 (lines=13) @@ | ||
65 | * |
|
66 | * @param int $user_id ID of the user against which save() is ran |
|
67 | **/ |
|
68 | public function save( $user_id ) { |
|
69 | // Unhook action to garantee single save |
|
70 | remove_action( 'profile_update', array( $this, '_save' ) ); |
|
71 | ||
72 | $this->set_user_id( $user_id ); |
|
73 | ||
74 | foreach ( $this->fields as $field ) { |
|
75 | $field->set_value_from_input(); |
|
76 | $field->save(); |
|
77 | } |
|
78 | ||
79 | do_action( 'carbon_after_save_user_meta', $user_id ); |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * Perform checks whether the container should be attached during the current request |