內容簡介
這個簡單的外掛程式會連接到 wp_enqueue_scripts 並移除 id='<handle of the css file>-css' 屬性。大部分情況下,您並不需要這些 ID。
我在我的伺服器上使用了 mod_pagespeed 模組,如果 <link> 標籤擁有 ID 屬性,combine_css 過濾器就會失效。因此,根據這篇部落格文章,我創建了一個非常簡單的 (基本上只有一行程式碼) 單純移除 ID 屬性的外掛程式。
此外,這個外掛程式還有一個簡單的單元測試,可以使用 wp-cli 創建: wp scaffod plugin ...。
祝您網站速度加快!🙂
您想要貢獻嗎?太棒了!請 fork 這個儲存庫,進行更改並建立 pull 要求。
外掛標籤
開發者團隊
原文外掛簡介
This simple plugin hooks to the wp_enqueue_scripts and removed the id='
I am using the mod_pagespeed module on my server and the combine_css filter doesn’t work if the tags have ID attributes. So based on this blog post I created a very very simple (basically one-liner) plugin that removes the ID attribute using regex.
There is also a very simple unit test for it, created using wp-cli: wp scaffod plugin ....
Enjoy the speedy sites! 🙂
Do you want to contribute? Great! Please fork this repository, make the changes and create a pull request.
