Title: Problem with hooks, causing content updating error
Last modified: March 18, 2019

---

# Problem with hooks, causing content updating error

 *  Resolved [carsonthetford](https://wordpress.org/support/users/carsonthetford/)
 * (@carsonthetford)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-hooks-causing-content-updating-error/)
 * I’m using the Theme Customisations plugin by Woocommerce to work with one of 
   the Woo child themes. I’m not really great at PHP yet and I think maybe what 
   I’ve written might be the reason this is causing the error. I successfully swapped
   where the cart and the search bar were hooked in. It was working great until 
   I tried to add in the bottom section with the “Added Login link to top header”.
   I wanted this link before the cart. Now I get errors like “Updating failed” when
   I try to update a page or any other content updates.
 * WP version – 5.1.1
    Theme – Homestore (Storefront child) Version: 2.0.29
 *     ```
       /*Custom Header hook changes
        * Swapped search and cart
        * */
       add_action('storefront_before_header', 'remove_storefront_product_search');
         function remove_storefront_product_search(){
           remove_action( 'storefront_header', 'storefront_product_search', 10);
         }
       add_action( 'storefront_header', 'storefront_product_search', 30 );
       add_action('storefront_before_header', 'remove_storefront_header_cart');
         function remove_storefront_header_cart(){
           remove_action( 'storefront_header', 'storefront_header_cart', 30);
         }
       add_action( 'storefront_header', 'storefront_header_cart', 12 );
       ?>
       <!-- Added Login link to top header -->
       <?php
       add_action( 'storefront_header', 'add_login_link', 11 );
         function add_login_link() {
           echo '<div class=login-top-link>
                   <a href=https://elevnn.com/my-account>Login</a>
                 </div>';
         }
       ?>
       <?php
       ```
   

Viewing 1 replies (of 1 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-hooks-causing-content-updating-error/#post-11326871)
 * You should ask in the support forum for the plugin or theme you are interfacing
   with.

Viewing 1 replies (of 1 total)

The topic ‘Problem with hooks, causing content updating error’ is closed to new 
replies.

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [update error](https://wordpress.org/support/topic-tag/update-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joy](https://wordpress.org/support/users/joyously/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-hooks-causing-content-updating-error/#post-11326871)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
