Closed lolux closed 8 years ago
@lolux do other error messages still show up with this removed?
@jessepollak to make sure I'm tracking with you:
First, the problem I'm trying to solve is to remove the empty message bubble (screenshot) that appears when completing the plugin setup wizard. I'm not yet sure why, but this bubble only appears on certain hosting setups. If this is a bug, it is minor: not affecting performance, and it disappears on subsequent loads of the settings page.
Second, if you mean other WP errors (admin notices), yes, verified with the following test.
Test 1: admin notices
function sample_admin_notice__error() {
$class = 'notice notice-error';
$message = __( 'This is a non-Clef test error message.', 'sample-text-domain' );
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
}
add_action( 'admin_notices', 'sample_admin_notice__error' );
Test 2: add_settings_error()
Third, if you mean other Clef settings errors, I think it should be, but my test is returning errors.
I think the div
in the settings.tpl
is redundant since settings_errors(), which we call here, outputs its own div
.
However, when I attempt to run a test error by adding
add_settings_error( 'wpclef', 'test_error', 'This is a Clef test error message.', 'error' );
to the ClassSettings constructor, the results are as follows:
ajax_settings_save_wpclef
div
in question is present or absent from settings.tpl.php
Is there a better way to test the Clef settings errors than what I have going in Test 2?
@lolux I'm thinking about case (2), i.e. when our settings save or another AJAX action returns an error. I think the best way to simulate this is to just return a WP_Error
in an AJAX function, an example of which you can find here.
Closing after further discussion: this div
is in fact used.
This was displaying as an empty
div class=message
upon completing the setup wizard on some hosts (e.g., WP Engine) but not others (e.g., GoDaddy).Appears to be unused. . . .