fix(theme): repair page display frontend regressions
This commit is contained in:
1 parent
1436232a34
commit
55571648a0
3 files changed
+14
-2
No files matched your search
@@ -527,7 +527,6 @@ trait ScriptsPart1c {
|
|||||||
// 用户状态
|
// 用户状态
|
||||||
'isLoggedIn' => is_user_logged_in(),
|
'isLoggedIn' => is_user_logged_in(),
|
||||||
'userId' => get_current_user_id(),
|
'userId' => get_current_user_id(),
|
||||||
'cartUrl' => $runtime_routes['cart'],
|
|
||||||
'ordersUrl' => $runtime_routes['orders'],
|
'ordersUrl' => $runtime_routes['orders'],
|
||||||
'userCenterUrl' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'),
|
'userCenterUrl' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'),
|
||||||
'routes' => [
|
'routes' => [
|
||||||
@@ -536,7 +535,6 @@ trait ScriptsPart1c {
|
|||||||
'register' => function_exists('aksrt_get_register_url') ? aksrt_get_register_url() : wp_registration_url(),
|
'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(),
|
'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/'),
|
'profile' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/profile/'),
|
||||||
'cart' => $runtime_routes['cart'],
|
|
||||||
'orders' => $runtime_routes['orders'],
|
'orders' => $runtime_routes['orders'],
|
||||||
'resources' => $runtime_routes['resources'],
|
'resources' => $runtime_routes['resources'],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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}
|
* @return array {m_s, img, img_dark, title, custom_code}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ const routes = read('assets/admin/src/constants/sections/page-display.js')
|
|||||||
const controller = read('src/Admin/PageDisplayController.php')
|
const controller = read('src/Admin/PageDisplayController.php')
|
||||||
const controllerBase = read('src/Admin/ControllerBase.php')
|
const controllerBase = read('src/Admin/ControllerBase.php')
|
||||||
const provider = read('src/Admin/SchemaProvider.php')
|
const provider = read('src/Admin/SchemaProvider.php')
|
||||||
|
const settingsFacade = read('src/Settings/Settings.php')
|
||||||
|
const scriptsPart1c = read('src/Core/ScriptsPart1c.php')
|
||||||
|
|
||||||
function activeRepositorySource() {
|
function activeRepositorySource() {
|
||||||
const roots = ['assets/admin/src', 'assets/js', 'inc', 'src', 'templates']
|
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_category_page_settings/)
|
||||||
assert.match(termMeta, /get_tag_page_settings/)
|
assert.match(termMeta, /get_tag_page_settings/)
|
||||||
assert.match(footer, /get_footer_template/)
|
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', () => {
|
test('save contract rejects invalid input and round-trips canonical nested values', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user