問題描述
有沒有辦法編輯文本 「感謝您使用 Wordpress 創建」3.3.1 版本在 CMS 的底部?如果是這樣,我需要編輯什麼文件?
最佳解決方案
信用肯定是 @kaiser,但這裏是一個全面的工作解決方案。您可以將此代碼添加到您的 functions.php 文件 (在您的主題中):
function wpse_edit_footer() {
add_filter( 'admin_footer_text', 'wpse_edit_text', 11 );
}
function wpse_edit_text($content) {
return "New Footer Text";
}
add_action( 'admin_init', 'wpse_edit_footer' );
次佳解決方案
只是掛在過濾器。剩下的只有<hr /> 。
/**
* Change/Disable the footer text line
* @return void
*/
function wpse_remove_footer()
{
add_filter( 'admin_footer_text', '__return_false', 11 );
add_filter( 'update_footer', '__return_false', 11 );
}
add_action( 'admin_init', 'wpse_remove_footer' );
如果你想改變它:
add_action( 'admin_init', function()
{
add_filter( 'admin_footer_text', function() {
echo "This is a custom admin footer text";
}, 11 );
add_filter( 'update_footer', function() {
echo "This is a custom footer update text";
}, 11 );
} );
參考文獻
注:本文內容整合自 Google/Baidu/Bing 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。