Skip to content

Conversation

@aslamdoctor
Copy link
Contributor

What?

Closes
#128

Fix duplicate settings notice by specifying option group in settings_errors()

Why?

While changing and saving any changes on AI Experiments page under admin, it was showing the success message as "Settings saved." twice. This PR fixes it to appear only once.

How?

Specified option group under settings_error() method as below

settings_errors('ai_experiments');

Testing Instructions

  1. Go to "Admin > Settings > AI Experiments" Page
  2. Change / Don't change any settings on this page
  3. Click "Save Changes"

Testing Instructions for Keyboard

Screenshots or screencast

Before After
image image

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jeffpaul <[email protected]>
Co-authored-by: aslamdoctor <[email protected]>
Co-authored-by: mindctrl <[email protected]>
Co-authored-by: dkotter <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 27.33%. Comparing base (8cc94c8) to head (0345649).
⚠️ Report is 20 commits behind head on develop.

Files with missing lines Patch % Lines
includes/Settings/Settings_Page.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #130   +/-   ##
==========================================
  Coverage      27.33%   27.33%           
  Complexity       152      152           
==========================================
  Files             14       14           
  Lines            900      900           
==========================================
  Hits             246      246           
  Misses           654      654           
Flag Coverage Δ
unit 27.33% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@mindctrl mindctrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected.

?>

<?php settings_errors(); ?>
<?php settings_errors( 'ai_experiments' ); ?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my mistake coming out of #100. Originally I was using this to display errors logged using add_settings_error but then removed that as it wasn't needed, but forgot to remove this. We could just remove this line for now but I'm also fine leaving this in case we do have settings errors we want to display in the future

@dkotter dkotter merged commit 3173ef0 into WordPress:develop Dec 2, 2025
24 of 26 checks passed
@dkotter dkotter added this to the 0.2.0 milestone Dec 2, 2025
@dkotter dkotter linked an issue Dec 2, 2025 that may be closed by this pull request
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Settings saved" message appears twice

3 participants