I am not a PHP programmer, but tried to use your code in a PHP snippet plugin. The code you provided is below and 15211 & 1359 are valid page ID’s within my site.
update_option( ‘relevanssi_exclude_posts’, function() { return ‘15211,1359’; } );
HERE IS THE ERROR I GOT WHEN TRYING TO ACTIVATE IT. IS THIS SOMETHING SIMPLE OR COMPLICATED? WILL 4.9.2 BE RELEASED SOON OR IS IT MONTHS OUT?
THANK YOU FOR YOUR PROMPT RESPONSE.
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 599:
Uncaught Exception: Serialization of ‘Closure’ is not allowed in /home1/t1/public_html/m/wp-includes/functions.php:599 Stack trace: #0 /home1/t1/public_html/m/wp-includes/functions.php(599): serialize(Object(Closure)) #1 /home1/t1/public_html/m/wp-includes/option.php(405): maybe_serialize(Object(Closure)) #2 /home1/t1/public_html/m/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(213) : eval()’d code(1): update_option(‘relevanssi_excl…’, Object(Closure)) #3 /home1/t1/public_html/m/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(213): eval() #4 /home1/t1/public_html/m/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(263): Code_Snippets_Edit_Menu->test_code(Object(Code_Snippet)) #5 /home1/t1/public_html/m/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(122): Code_Snippets_Edit_Menu->s
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.
Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.