Custom plugin settings: clicking “save changes” does not display success message

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 
}

1 Answer
1

I had the same issue as you did, but I found how to fix it in this tutorial:

https://digwp.com/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.

Leave a Comment