| @@ -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 | ], |
| @@ -35,12 +42,8 @@ | ||
| 35 | 42 | 'title' => 'Account', |
| 36 | 43 | 'content' => '<!-- wp:fluent-cart/customer-profile /-->' |
| 37 | 44 | ] |
| 38 | 45 | ]; |
| 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 | 46 | } |
| 44 | 47 | |
| 45 | 48 | |
| 46 | 49 | public function createPages(array $exclude = []): array |