Home WordPress Settings API add_settings_error() issue
Reply: 0

WordPress Settings API add_settings_error() issue

user951 Published in June 19, 2018, 11:59 pm

To create plugin custom settings page using wp Settings API wordpress suggests us to use something like this:

<form method="post" action="options.php">
    <?php settings_fields( 'group_name' );
    do_settings_sections( 'group_name' );
    submit_button( 'Save Changes' ); ?>

When I add the settings page errors using the add_settings_error() all the things work great. But I have noticed that if action="" I'll get 2 copies of the same custom error.

get_settings_errors() returns an array with 0 and 2 keys (1 is missed). In 0 and 2 lays the same custom errors (duplicates).

I am sure it is not an issue of my code due to with action="options.php" I have not this issue.

It seems I do not know something. Can somebody explain me?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.259849 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO