• Resolved thegrbteam

    (@thegrbteam)


    Hello, excellent plugin, thank you. We have some snippets that are critical to our websites features so if they error, would would rather deal with the error than have the snippet secretly turned off. This approach keeps backfiring for us! Is there a way to prevent the “automatically deactivated” feature please?

    https://wpcode.com/docs/php-error-handling-safe-mode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @thegrbteam,

    Thank you – we’re happy to hear you like the plugin.

    You can disable the automatic disabling of snippets using the filter wpcode_error_locations_auto_disable.

    This allows you to specify for which auto-insert locations a snippet should be automatically disabled if it encounters an error.

    You can use the following code to prevent automatic disabling for all snippets:

    add_filter( 'wpcode_error_locations_auto_disable', '__return_empty_array' );

    Please note that adding this filter using a WPCode snippet might not always work as intended unless this is the first snippet loaded (you can use a lower priority number).

    Thread Starter thegrbteam

    (@thegrbteam)

    Thank you for the quick reply and solution. I’ve added a new snippet “Turn off WPCode automatically deactivated feature” containing:

    add_filter( 'wpcode_error_locations_auto_disable', '__return_empty_array' );

    I’ve given it a priority of 1.

    I’m not really sure how to test it but I will update here if it ever happens again.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable “automatically deactivated” feature?’ is closed to new replies.