← All changes
|
jetpack_vendor/automattic/jetpack-import/src/endpoints/class-page.php
+7
-0
13.5.2
→
16.3
View file →
| @@ -10,8 +10,12 @@ | ||
| 10 | 10 | use WP_Error; |
| 11 | 11 | use WP_REST_Request; |
| 12 | 12 | use WP_REST_Response; |
| 13 | 13 | |
| 14 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | + exit( 0 ); | |
| 16 | +} | |
| 17 | + | |
| 14 | 18 | /** |
| 15 | 19 | * Class Page |
| 16 | 20 | */ |
| 17 | 21 | class Page extends Post { |
| @@ -29,8 +33,11 @@ | ||
| 29 | 33 | * @param WP_REST_Request $request Full details about the request. |
| 30 | 34 | * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| 31 | 35 | */ |
| 32 | 36 | public function create_item( $request ) { |
| 37 | + // Set the WP_IMPORTING constant to prevent sync notifications | |
| 38 | + $this->set_importing(); | |
| 39 | + | |
| 33 | 40 | if ( ! empty( $request['parent'] ) ) { |
| 34 | 41 | $pages = \get_pages( $this->get_import_db_query( $request['parent'] ) ); |
| 35 | 42 | |
| 36 | 43 | // Overwrite the page parent page ID. |