diff --git a/src/Core/ScriptsPart1c.php b/src/Core/ScriptsPart1c.php index 18df0088..e415ffa3 100644 --- a/src/Core/ScriptsPart1c.php +++ b/src/Core/ScriptsPart1c.php @@ -527,7 +527,6 @@ trait ScriptsPart1c { // 用户状态 'isLoggedIn' => is_user_logged_in(), 'userId' => get_current_user_id(), - 'cartUrl' => $runtime_routes['cart'], 'ordersUrl' => $runtime_routes['orders'], 'userCenterUrl' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'), 'routes' => [ @@ -536,7 +535,6 @@ trait ScriptsPart1c { 'register' => function_exists('aksrt_get_register_url') ? aksrt_get_register_url() : wp_registration_url(), 'resetPassword' => function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_password_url() : wp_lostpassword_url(), 'profile' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/profile/'), - 'cart' => $runtime_routes['cart'], 'orders' => $runtime_routes['orders'], 'resources' => $runtime_routes['resources'], ], diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index 2f85c725..b21e7f23 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -827,6 +827,15 @@ class Settings { + /** + * 获取页脚布局模板。 + */ + public static function get_footer_template(): string { + return HomeCms::get_footer_template(); + } + + + /** * 获取页脚品牌列(第一列)配置 * @return array {m_s, img, img_dark, title, custom_code} diff --git a/tests/widget-system/page-display-contract.test.cjs b/tests/widget-system/page-display-contract.test.cjs index 06191459..20ab1a06 100644 --- a/tests/widget-system/page-display-contract.test.cjs +++ b/tests/widget-system/page-display-contract.test.cjs @@ -11,6 +11,8 @@ const routes = read('assets/admin/src/constants/sections/page-display.js') const controller = read('src/Admin/PageDisplayController.php') const controllerBase = read('src/Admin/ControllerBase.php') const provider = read('src/Admin/SchemaProvider.php') +const settingsFacade = read('src/Settings/Settings.php') +const scriptsPart1c = read('src/Core/ScriptsPart1c.php') function activeRepositorySource() { const roots = ['assets/admin/src', 'assets/js', 'inc', 'src', 'templates'] @@ -158,6 +160,9 @@ test('front-end page-display consumers read only the canonical section contracts assert.match(termMeta, /get_category_page_settings/) assert.match(termMeta, /get_tag_page_settings/) assert.match(footer, /get_footer_template/) + assert.match(settingsFacade, /public static function get_footer_template\(\): string\s*\{\s*return HomeCms::get_footer_template\(\);\s*\}/) + assert.equal(scriptsPart1c.includes('cartUrl'), false) + assert.doesNotMatch(scriptsPart1c, /\$runtime_routes\[['"]cart['"]\]/) }) test('save contract rejects invalid input and round-trips canonical nested values', () => {