| @@ -13,9 +13,16 @@ | ||
| 13 | 13 | protected static array $cachedPages = []; |
| 14 | 14 | |
| 15 | 15 | public function pages(): array |
| 16 | 16 | { |
| 17 | - $pages = [ | |
| 17 | + // Lets addons register their own generatable pages ('key' => title + content), | |
| 18 | + // so the Pages Setup "+" create button and onboarding can build them. | |
| 19 | + return apply_filters('fluent_cart/generatable_pages', $this->corePages()); | |
| 20 | + } | |
| 21 | + | |
| 22 | + public function corePages(): array | |
| 23 | + { | |
| 24 | + return [ | |
| 18 | 25 | 'checkout' => [ |
| 19 | 26 | 'title' => 'Checkout', |
| 20 | 27 | 'content' => '[fluent_cart_checkout]' |
| 21 | 28 | ], |
| @@ -26,8 +33,12 @@ | ||
| 26 | 33 | 'receipt' => [ |
| 27 | 34 | 'title' => 'Receipt', |
| 28 | 35 | 'content' => '[fluent_cart_receipt]' |
| 29 | 36 | ], |
| 37 | + 'order_review' => [ | |
| 38 | + 'title' => 'Review Your Order', | |
| 39 | + 'content' => '[fluent_cart_order_review]' | |
| 40 | + ], | |
| 30 | 41 | 'shop' => [ |
| 31 | 42 | 'title' => 'Shop', |
| 32 | 43 | 'content' => static::getShopPageContent() |
| 33 | 44 | ], |
| @@ -35,12 +46,8 @@ | ||
| 35 | 46 | 'title' => 'Account', |
| 36 | 47 | 'content' => '<!-- wp:fluent-cart/customer-profile /-->' |
| 37 | 48 | ] |
| 38 | 49 | ]; |
| 39 | - | |
| 40 | - // Lets addons register their own generatable pages ('key' => title + content), | |
| 41 | - // so the Pages Setup "+" create button and onboarding can build them. | |
| 42 | - return apply_filters('fluent_cart/generatable_pages', $pages); | |
| 43 | 50 | } |
| 44 | 51 | |
| 45 | 52 | |
| 46 | 53 | public function createPages(array $exclude = []): array |