admin管理员组文章数量:1130349
I don't entirely understanding how to save my plugin's settings properly. When I click on the "Save Changes" button it saves data but it does not show any successful like message. Do I need to add an extra function or something else?
My form look like this:
function bdthemes_core_settings_page() { ?>
<div class="wrap">
<h1>BdThemes Settings</h1>
<form method="post" action="options.php">
<?php
settings_fields("section");
do_settings_sections("plugin-options");
submit_button();
?>
</form>
</div>
<?php
}
I don't entirely understanding how to save my plugin's settings properly. When I click on the "Save Changes" button it saves data but it does not show any successful like message. Do I need to add an extra function or something else?
My form look like this:
function bdthemes_core_settings_page() { ?>
<div class="wrap">
<h1>BdThemes Settings</h1>
<form method="post" action="options.php">
<?php
settings_fields("section");
do_settings_sections("plugin-options");
submit_button();
?>
</form>
</div>
<?php
}
Share
Improve this question
edited Aug 24, 2016 at 18:55
Selim Rana
asked Aug 24, 2016 at 18:43
Selim RanaSelim Rana
331 silver badge7 bronze badges
2
- Normally, using the Settings API as you have will cause a default "Settings Saved" message. The problem would be somewhere else in your mark-up, though you could also try writing an explicit custom message via the admin_notices hook. – CK MacLeod Commented Aug 24, 2016 at 23:36
- @CKMacLeod If one creates a sub menu and posts to options.php from there, it skips the message. – Talha Imam Commented Feb 15, 2021 at 22:54
1 Answer
Reset to default 6I had the same issue as you did, but I found how to fix it in this tutorial:
https://digwp/2016/05/wordpress-admin-notices/
Basically, I had my settings page outside of the Settings menu, so I had to explicitly add settings_errors() to my options page and they started working. :)
Hope that helps.
I don't entirely understanding how to save my plugin's settings properly. When I click on the "Save Changes" button it saves data but it does not show any successful like message. Do I need to add an extra function or something else?
My form look like this:
function bdthemes_core_settings_page() { ?>
<div class="wrap">
<h1>BdThemes Settings</h1>
<form method="post" action="options.php">
<?php
settings_fields("section");
do_settings_sections("plugin-options");
submit_button();
?>
</form>
</div>
<?php
}
I don't entirely understanding how to save my plugin's settings properly. When I click on the "Save Changes" button it saves data but it does not show any successful like message. Do I need to add an extra function or something else?
My form look like this:
function bdthemes_core_settings_page() { ?>
<div class="wrap">
<h1>BdThemes Settings</h1>
<form method="post" action="options.php">
<?php
settings_fields("section");
do_settings_sections("plugin-options");
submit_button();
?>
</form>
</div>
<?php
}
Share
Improve this question
edited Aug 24, 2016 at 18:55
Selim Rana
asked Aug 24, 2016 at 18:43
Selim RanaSelim Rana
331 silver badge7 bronze badges
2
- Normally, using the Settings API as you have will cause a default "Settings Saved" message. The problem would be somewhere else in your mark-up, though you could also try writing an explicit custom message via the admin_notices hook. – CK MacLeod Commented Aug 24, 2016 at 23:36
- @CKMacLeod If one creates a sub menu and posts to options.php from there, it skips the message. – Talha Imam Commented Feb 15, 2021 at 22:54
1 Answer
Reset to default 6I had the same issue as you did, but I found how to fix it in this tutorial:
https://digwp/2016/05/wordpress-admin-notices/
Basically, I had my settings page outside of the Settings menu, so I had to explicitly add settings_errors() to my options page and they started working. :)
Hope that helps.
本文标签: Custom plugin settings clicking quotsave changesquot does not display success message
版权声明:本文标题:Custom plugin settings: clicking "save changes" does not display success message 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749184616a2329178.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论