refactor: 死代码清理 + CDN SRI 加固 + 面包屑组件 + 代码规范文档
- 删除 7 个死模板文件 (products/services/quality/process/projects/customization/rfq) - 删除 13 个旧图片素材 (jpg/png/webp) - 新增 CDN SRI 完整性校验 (Bootstrap CSS/JS) - 新增面包屑导航模板组件 - 新增代码清理方案与代码审查标准文档 - 更新 README.md
This commit is contained in:
@@ -64,3 +64,25 @@ function fragrance_trade_notice_message( $code ) {
|
||||
);
|
||||
return isset( $messages[ $code ] ) ? $messages[ $code ] : '';
|
||||
}
|
||||
|
||||
add_action(
|
||||
'admin_notices',
|
||||
function () {
|
||||
$locations = get_nav_menu_locations();
|
||||
$menu_id = isset( $locations['primary'] ) ? $locations['primary'] : 0;
|
||||
if ( ! $menu_id ) {
|
||||
return;
|
||||
}
|
||||
$items = wp_get_nav_menu_items( $menu_id );
|
||||
$count = $items ? count( $items ) : 0;
|
||||
if ( $count < 2 ) {
|
||||
printf(
|
||||
'<div class="notice notice-warning is-dismissible"><p><strong>%s</strong> %s <a href="%s">%s</a></p></div>',
|
||||
esc_html__( '主导航菜单项过少', 'fragrance-trade' ),
|
||||
esc_html__( '手机端和桌面端导航目前只显示一个菜单项。请前往后台添加:首页、服务项目、案例作品、关于门店、常见问题、预约联系。', 'fragrance-trade' ),
|
||||
esc_url( admin_url( 'nav-menus.php' ) ),
|
||||
esc_html__( '编辑菜单', 'fragrance-trade' )
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user