Title: Code stopped working
Last modified: March 4, 2022

---

# Code stopped working

 *  Resolved [gusy](https://wordpress.org/support/users/gusy/)
 * (@gusy)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/)
 * Hello.
    I have been using a code for some time so that the ecommerce does not
   show the provinces of the Canary Islands, Melilla, Ceuta and Balearic Islands
   in the shipping address. So far it worked correctly, but now the code does not
   work and shows those provinces. Could you help me? The code is as follows:
 *     ```
       function afr_limita_envios ($provincias) {
       unset ($provincias [‘ES’] [‘TF’]);
       unset ($provincias [‘ES’] [‘GC’]);
       unset ($provincias [‘ES’] [‘CE’]);
       unset ($provincias [‘ES’] [‘ML’]);
       unset ($provincias [‘ES’] [‘PM’]);
       return $provincias;
       }
       add_filter (‘woocommerce_states’, ‘afr_limita_envios’);
       ```
   
    -  This topic was modified 4 years, 3 months ago by [gusy](https://wordpress.org/support/users/gusy/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-stopped-working-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Elías](https://wordpress.org/support/users/eliasgdj/)
 * (@eliasgdj)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15426490)
 * No creo que tenga que ver con Code Snippets, salvo que hayas desactivado el snippet
   o configurado que se ejecute en el backend.
 * ¿Ese hook sigue estando vigente? Si haces un var_dump() de $provincias, ¿qué 
   sale?
 *  Thread Starter [gusy](https://wordpress.org/support/users/gusy/)
 * (@gusy)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15426822)
 * Hola.
    No he cambiado nada, ni tampoco desactivado el Code Snippets. Lo del var_dump()
   no se como comprobarlo, lo siento
 *  [Elías](https://wordpress.org/support/users/eliasgdj/)
 * (@eliasgdj)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15427036)
 * Si puedes déjanos una captura de pantalla, puedes subirla a [https://imgur.com/](https://imgur.com/)
 *  Thread Starter [gusy](https://wordpress.org/support/users/gusy/)
 * (@gusy)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15427126)
 * > [View post on imgur.com](https://imgur.com/bVkXeCF)
 * También puedes comprobarlo entrando en la web y añadiendo un producto a la cesta.
   Cuando vas a finalizar compra, al seleccionar la provincia, te aparecen esas 
   que no deberían aparecer.
 *  [Elías](https://wordpress.org/support/users/eliasgdj/)
 * (@eliasgdj)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15427233)
 * Las comillas que estás usando no son correctas, deben ser `'` y no `’`.
 * Me he fijado antes pero he pensado que era cosa del formateador de código o del
   pegado.
 *  Thread Starter [gusy](https://wordpress.org/support/users/gusy/)
 * (@gusy)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15427265)
 * Pues no lo entiendo.
    Las he cambiado y funciona. Pero lleva 2 años funcionando
   como estaba y probado…
 * Muchísimas gracias por tu ayuda.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Code stopped working’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [gusy](https://wordpress.org/support/users/gusy/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/code-stopped-working-3/#post-15427265)
 * Status: resolved