• Resolved somto

    (@somto)


    Hello

    Please, I’m having issues when I try to modify and update my code snippet

    I don’t have any function declared more than once in my code

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

    (@gripgrip)

    Hi @somto,

    You are running into that issue because in the process we use to evaluate code for errors the code is actually executed and thus it declares the function again.

    You can either add a check with function_exists to prevent the error or make changes with the snippet deactivated and activated it when done.

    Thread Starter somto

    (@somto)

    @gripgrip

    i have tried to update the snippet while deactivated, but it broke my site with error 500

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @somto,

    If you are getting an error while trying to update the snippet it’s likely that your snippet code is blocking execution of the code to the end.

    From the name of the function in your screenshot I believe you are using the “pre_get_posts” action? If you are running that with no restrictions you might be short-circuiting the save process.

    Would it be possible to reach out using the form at https://wpcode.com/contact so that you can share more details about the snippet?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Having problem updating and and activate code’ is closed to new replies.