|
@@ 53-62 (lines=10) @@
|
| 50 |
|
|
| 51 |
|
$payload = $this->app->request()->payload(); |
| 52 |
|
|
| 53 |
|
if ( $payload->has_error() ) { |
| 54 |
|
return $this->app->response()->error( new WP_Error( |
| 55 |
|
'invalid_payload', |
| 56 |
|
sprintf( |
| 57 |
|
__( "%s won't be imported. Error: %s", 'wp-github-sync' ), |
| 58 |
|
strtolower( $payload->get_commit_id() ) ? : '[Missing Commit ID]', |
| 59 |
|
$payload->get_error() |
| 60 |
|
) |
| 61 |
|
) ); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
if ( ! $payload->should_import() ) { |
| 65 |
|
return $this->app->response()->error( new WP_Error( |
|
@@ 64-72 (lines=9) @@
|
| 61 |
|
) ); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
if ( ! $payload->should_import() ) { |
| 65 |
|
return $this->app->response()->error( new WP_Error( |
| 66 |
|
'invalid_payload', |
| 67 |
|
sprintf( |
| 68 |
|
__( "%s won't be imported.", 'wp-github-sync' ), |
| 69 |
|
strtolower( $payload->get_commit_id() ) ? : '[Missing Commit ID]' |
| 70 |
|
) |
| 71 |
|
) ); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
$this->app->semaphore()->lock(); |
| 75 |
|
remove_action( 'save_post', array( $this, 'export_post' ) ); |