@@ 183-201 (lines=19) @@ | ||
180 | ||
181 | foreach ( $this->sync as $sync_operation_type => $sync_operations ) { |
|
182 | switch ( $sync_operation_type ) { |
|
183 | case 'post': |
|
184 | if ( $wp_importing ) { |
|
185 | break; |
|
186 | } |
|
187 | ||
188 | $global_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null; |
|
189 | $GLOBALS['post'] = null; |
|
190 | foreach ( $sync_operations as $post_id => $settings ) { |
|
191 | $sync_data['post'][$post_id] = $this->get_post( $post_id ); |
|
192 | if ( isset( $this->post_transitions[$post_id] ) ) { |
|
193 | $sync_data['post'][$post_id]['transitions'] = $this->post_transitions[$post_id]; |
|
194 | } else { |
|
195 | $sync_data['post'][$post_id]['transitions'] = array( false, false ); |
|
196 | } |
|
197 | $sync_data['post'][$post_id]['on_behalf_of'] = $settings['on_behalf_of']; |
|
198 | } |
|
199 | $GLOBALS['post'] = $global_post; |
|
200 | unset( $global_post ); |
|
201 | break; |
|
202 | case 'comment': |
|
203 | if ( $wp_importing ) { |
|
204 | break; |
|
@@ 202-220 (lines=19) @@ | ||
199 | $GLOBALS['post'] = $global_post; |
|
200 | unset( $global_post ); |
|
201 | break; |
|
202 | case 'comment': |
|
203 | if ( $wp_importing ) { |
|
204 | break; |
|
205 | } |
|
206 | ||
207 | $global_comment = isset( $GLOBALS['comment'] ) ? $GLOBALS['comment'] : null; |
|
208 | unset( $GLOBALS['comment'] ); |
|
209 | foreach ( $sync_operations as $comment_id => $settings ) { |
|
210 | $sync_data['comment'][$comment_id] = $this->get_comment( $comment_id ); |
|
211 | if ( isset( $this->comment_transitions[$comment_id] ) ) { |
|
212 | $sync_data['comment'][$comment_id]['transitions'] = $this->comment_transitions[$comment_id]; |
|
213 | } else { |
|
214 | $sync_data['comment'][$comment_id]['transitions'] = array( false, false ); |
|
215 | } |
|
216 | $sync_data['comment'][$comment_id]['on_behalf_of'] = $settings['on_behalf_of']; |
|
217 | } |
|
218 | $GLOBALS['comment'] = $global_comment; |
|
219 | unset( $global_comment ); |
|
220 | break; |
|
221 | case 'option' : |
|
222 | foreach ( $sync_operations as $option => $settings ) { |
|
223 | $sync_data['option'][ $option ] = array( 'value' => get_option( $option ) ); |