November 5

How to add the wordpress settings saved message to plugins

1  comments

If you are a wordpress developer and you code plugins that have variable settings inserted with register_setting() function into the database, then you must also add a notice to inform users when specific options or settings are saved. In order to do that, you’ll just need to add the following code snippet, anywhere in your form:

[php]
<?php if( isset($_GET[‘settings-updated’]) ) { ?>
<div id=”message” class=”updated”>
<p><strong><?php _e(‘Settings saved.’) ?></strong></p>
</div>
<?php } ?>
[/php]

Good luck.


Tags

add, message.notice, saved, settings, wordpress


You may also like

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get in touch

Name*
Email*
Message
0 of 350