If clicking the close button does not make the notice disappear, then there likely is a JavaScript conflict with another plugin pixels76.
As an alternative you can use this code snippet to never see it again;
add_filter(‘autoptimize_filter_main_imgopt_plug_notice’,’__return_empty_string’);
Hope this helps,
frank
clicking the close button make the notice disappear, but ….. this notice pop up immediately on the next screen, again and again, every screen, every page, every day … STOP !
And i cannot or i don’t know how and where i have to put your “snippet”.
Well, as I wrote;
If clicking the close button does not make the notice disappear, then there likely is a JavaScript conflict with another plugin pixels76
So this is not something I can simply make disappear on my end without at least knowing more about what is conflicting. If you have time & want to help out, you can always try disabling (and re-enabling) plugins one at a time and see which one helps getting the JS call through to AO to indeed dismiss the notice.
And i cannot or i don’t know how and where i have to put your “snippet”.
the easiest/ safest way is to use the code snippets plugin, but alternatively you could simply add it to your (child) theme’s functions.php.
bien à toi,
frank
Hi,
I installed the Code Snippets plugin and created an extract with the line:
add_filter (‘autoptimize_filter_main_imgopt_plug_notice’, ‘__ return_empty_string’);
but nothing happens.
I still have that cursed message …
just to make sure;
do you have
add_filter (‘autoptimize_filter_main_imgopt_plug_notice’, ‘__ return_empty_string’);
or
add_filter('autoptimize_filter_main_imgopt_plug_notice', '__ return_empty_string');
(no space after add_filter + ' instead of ‘)
Hmmm .. It seems that there is a subtlety which escapes me …
For spaces, no problem. But on the other side, how do you enter the sign ‘ on the keyboard?
so to be clear; you need the 2nd one from my previous post. re. quatation marks; you want to use the normal single quote, beneath the 4 on my azerty keyboard.
Yes, i made that. Now, there is no more sentence but the frame which was around this sentence remains displayed.
that’s weird … let me check the code …
Ok, I can wait, since all this time …
In any case, thank you for advising me on this Code Snippets plugin. I had put CSS code directly in the options of my theme. I transferred this code to a snippet, everything works fine.
This procedure also seems more logical, right?
weird indeed; the code reads something like “if imgopt_plug_notice string is empty then don’t show the notice”, see https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeMain.php#L669
if all else fails (for reasons i can’t understand) you could change the condition from
if ( current_user_can( 'manage_options' ) && '' !== $_ao_imgopt_plug_notice && ! $_ao_imgopt_active && $_ao_imgopt_launch_ok && PAnD::is_admin_notice_active( $_ao_imgopt_plug_dismissible ) ) {
into
if ( false && current_user_can( 'manage_options' ) && '' !== $_ao_imgopt_plug_notice && ! $_ao_imgopt_active && $_ao_imgopt_launch_ok && PAnD::is_admin_notice_active( $_ao_imgopt_plug_dismissible ) ) {
Hello,
back on this problem …
I see today that the frame always appears, but, furthermore, I have a warning:
Warning: call_user_func_array () expects parameter 1 to be a valid callback, function ‘__ return_empty_string’ not found or invalid function name in /htdocs/wp-includes/class-wp-hook.php on line 287
I checked that it was the attempt to delete the notice that is at issue, and moreover, I had not changed anything in the code of the snippet.
After modifying the code in autoptimizeMain.php, the warning has not disappeared.
In the meantime, I will revert to the original version of autoptimizeMain.php.
Thank you for your attention.
-
This reply was modified 6 years, 1 month ago by
pixels76.
arrggggghhhh, now I see; '__ return_empty_string' should be '__return_empty_string' (so no space between __ and return ) …
OK, I change this, and IT WORKS !
Thank you very much.
De rien pixels76 🙂
greetings from Belgium!
frank