• Resolved pydie

    (@pydie)


    Is there any way to execute flush_rewrite_rules(); everytime woocommerce is updated?
    I’ve created a new page under my-account using add_rewrite_endpoint and
    add_action('woocommerce_account_myproducts_endpoint', 'myproducts_endpoint_content');

    But every time woocommerce is updated I get 404 if I try to access to /my-account/myproducts, so I need to flush permalinks.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @pydie,

    That’s an interesting question. You may be able to do it with something like this:

    
    add_action( 'woocommerce_updated', 'flush_rewrite_rules' );
    

    I haven’t tested it, so make sure to give it a try on your site. Hopefully, that will do the trick for you.

    Cheers

    Plugin Support EtienneP a11n

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Thread Starter pydie

    (@pydie)

    Sorry guys, I forgot to leave an answer.

    @3sonsdevelopment thank you!

    @etiennep mark this as resolved

    Diego.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘After woocommerce update I need to flush rewrite_rules’ is closed to new replies.