admin管理员组文章数量:1130349
The Wordpress admin backend displays the following footer text for each page of the admin panel: 'Thank you for creating with Wordpress'.
What is the cleanest way to update this text for a particular plugin page only ?
Currently I have added a filter for the 'admin_footer_text' hook, however, this has the effect of updating all page footers on the backend, not just those specific to my plugin.
Is it a case of using the 'admin_footer_text' hook, and adding some conditional checking around which admin panel page is being called? Or is there a cleaner, more direct hook I should be using?
The Wordpress admin backend displays the following footer text for each page of the admin panel: 'Thank you for creating with Wordpress'.
What is the cleanest way to update this text for a particular plugin page only ?
Currently I have added a filter for the 'admin_footer_text' hook, however, this has the effect of updating all page footers on the backend, not just those specific to my plugin.
Is it a case of using the 'admin_footer_text' hook, and adding some conditional checking around which admin panel page is being called? Or is there a cleaner, more direct hook I should be using?
Share Improve this question edited Dec 15, 2018 at 14:56 Scratcha asked Dec 15, 2018 at 14:35 ScratchaScratcha 1152 silver badges7 bronze badges 4- Should everybody guess the plugin name? – Max Yudin Commented Dec 15, 2018 at 14:45
- I don't see how the particular plugin name is relevant to the question ? – Scratcha Commented Dec 15, 2018 at 14:53
- May be it has a hook to modify it's footer. Now content yourself with generic code. – Max Yudin Commented Dec 15, 2018 at 14:59
- It's my own custom plugin... – Scratcha Commented Dec 15, 2018 at 18:41
1 Answer
Reset to default 1<?php
// check the plugin admin page
if( is_admin() && isset( $_GET['page'] ) && 'PLUGIN-NAME' == $_GET['page'] ) {
// replace the footer with empty string
add_filter( 'admin_footer_text', '__return_empty_string' );
}
The Wordpress admin backend displays the following footer text for each page of the admin panel: 'Thank you for creating with Wordpress'.
What is the cleanest way to update this text for a particular plugin page only ?
Currently I have added a filter for the 'admin_footer_text' hook, however, this has the effect of updating all page footers on the backend, not just those specific to my plugin.
Is it a case of using the 'admin_footer_text' hook, and adding some conditional checking around which admin panel page is being called? Or is there a cleaner, more direct hook I should be using?
The Wordpress admin backend displays the following footer text for each page of the admin panel: 'Thank you for creating with Wordpress'.
What is the cleanest way to update this text for a particular plugin page only ?
Currently I have added a filter for the 'admin_footer_text' hook, however, this has the effect of updating all page footers on the backend, not just those specific to my plugin.
Is it a case of using the 'admin_footer_text' hook, and adding some conditional checking around which admin panel page is being called? Or is there a cleaner, more direct hook I should be using?
Share Improve this question edited Dec 15, 2018 at 14:56 Scratcha asked Dec 15, 2018 at 14:35 ScratchaScratcha 1152 silver badges7 bronze badges 4- Should everybody guess the plugin name? – Max Yudin Commented Dec 15, 2018 at 14:45
- I don't see how the particular plugin name is relevant to the question ? – Scratcha Commented Dec 15, 2018 at 14:53
- May be it has a hook to modify it's footer. Now content yourself with generic code. – Max Yudin Commented Dec 15, 2018 at 14:59
- It's my own custom plugin... – Scratcha Commented Dec 15, 2018 at 18:41
1 Answer
Reset to default 1<?php
// check the plugin admin page
if( is_admin() && isset( $_GET['page'] ) && 'PLUGIN-NAME' == $_GET['page'] ) {
// replace the footer with empty string
add_filter( 'admin_footer_text', '__return_empty_string' );
}
本文标签: Updating Wordpress plugin admin panel footer text
版权声明:本文标题:Updating Wordpress plugin admin panel footer text 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749095975a2315258.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论