惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LangChain Blog
博客园 - 【当耐特】
I
InfoQ
腾讯CDC
人人都是产品经理
人人都是产品经理
H
Help Net Security
Y
Y Combinator Blog
B
Blog
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
D
Docker
博客园 - 聂微东
B
Blog RSS Feed
G
Google Developers Blog

轻语博客

从 7711 元到单日 4.6 万:《牛来》的反向出圈,是烂片奇迹还是观众狂欢? QUX主题后台设置完整使用指南 QUX 主题内置短代码使用教程 什么是 LLMs.txt?它对SEO有用吗?WordPress 网站如何生成 LLMs.txt? QUX子主题模块化首页 Linux如何重启Redis?如何优化Redis性能? 宝塔面板自动重启数据库服务的shell脚本代码 2023奥维图源 免费谷歌地图 热门神器:ChatGPT在线,无需魔法开箱即用!最新接口高效稳定 WordPress 开发人员必备的 12 个工具 WP-China-Yes插件:将你的WordPress接入本土生态体系中 WordPress 6.2 引入 HTML API 修改HTML标签和属性
WordPress 移除菜单代码中没必要的部分
0 个人已赞 · 2025-09-10 · via 轻语博客
<li id="menu-item-223" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-223">
    菜单名
</li>
if (!function_exists('tb_css_attributes_filter')) :
    add_filter('nav_menu_css_class', 'tb_css_attributes_filter', 100, 1);
    add_filter('nav_menu_item_id', 'tb_css_attributes_filter', 100, 1);
    function tb_css_attributes_filter($var) {
        $arrs = array('current-menu-item', 'current-category-ancestor', 'current-post-ancestor', 'current-menu-ancestor', 'current-menu-parent', 'menu-item-has-children');
        return is_array($var) ? array_intersect($var, $arrs) : '';
    }
endif;