Conversation
| return $this->fix_term_relationships( $local_post['ID'], $post_args ); | ||
| } | ||
|
|
||
| if ( ! empty( $this->ps_meta_repair_fields ) ) { |
There was a problem hiding this comment.
What happens usually if this is empty? Can we reverse the condition to remove a level of nesting to make this block easier to read/
| return false; | ||
| } | ||
|
|
||
| if ( ! empty( $this->ps_meta_repair_fields ) ) { |
There was a problem hiding this comment.
The way both of these methods is structured doesn't allow us to reverse this just yet. It could at some point, but right now these "short-circuit" the login in the enclosing method and return early, otherwise the functions continue and do a lot of other work.
There was a problem hiding this comment.
This comment still shows for the similar line, however this is moved out from where it was earlier.
| $meta_result = array(); | ||
|
|
||
| foreach ( $post_args['meta_input'] as $field => $value ) { | ||
| if ( false === strpos( $field, 'press_sync_' ) && ! in_array( $field, $this->ps_meta_repair_fields ) ) { |
There was a problem hiding this comment.
If I was John L., I'd be asking whether we can put this if condition into a method with a more easily understood name so it better explains what's being processed. There's a lot of mental overhead here to figure out what we're checking.
|
This has been superceded by #41 and is now moot. |
This PR incorporates #35
The intent of this PR is to allow the ability to sync meta fields for posts and attachments instead of the entire post object.
This could be useful in situations where metadata is backfilled or updated on the source site, but we don't need to resync all posts completely.