• Resolved cincyexec

    (@cincyexec)


    Under the SEARCHING tab, the bottom of the page has an area for POST EXCLUSIONS. I had a post there previously (ID 5675). Now when I add a new post ID to this area and click SAVE THE OPTIONS, nothing happens. I have also tried to delete the current ID and click save and the ID still remains. I have tried in several different browsers and same result. Running version 4.9.0. which appears to be current release. Please advise…

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mikko Saari

    (@msaari)

    (Hmm, 4.9.1 is the current version, not 4.9.0; looks like I’ve forgotten to upload it.)

    Yes, this is currently broken, and will be fixed in 4.9.2.

    Meanwhile, you can do this in your theme functions.php or in a PHP snippet plugin:

    update_option( 'relevanssi_exclude_posts', function() { return '1,2,3,4'; } );

    where ‘1,2,3,4’ is what you would enter in the setting field.

    Thread Starter cincyexec

    (@cincyexec)

    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.

    Plugin Author Mikko Saari

    (@msaari)

    Oops, sorry, my bad. I don’t know what I was thinking there. Of course it needs to be like this:

    update_option( 'relevanssi_exclude_posts', '15211,1359' );

    This should work. I don’t know when 4.9.2 is coming out; hopefully in December.

    Thread Starter cincyexec

    (@cincyexec)

    Thanks for the prompt reply. It worked perfectly.

    Hi – the code for Post Exclusion is not working for me, I put it in functions.php and reindexed. Any ideas of other things I could try?

    Plugin Author Mikko Saari

    (@msaari)

    Update to 4.10.1, that’s all you need. If updating to 4.10.1 and setting the post exclusion setting does not work as expected, you’re having a different problem; please start a new support thread in that case and explain your problem in more detail.

    • This reply was modified 4 years, 3 months ago by Mikko Saari.

    Thanks, the update worked! Great plugin!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Post Exclusion Stopped Working After Recent Upgrade’ is closed to new replies.