Error 404 change permalink term custom term taxonomy

If you just want the category permalink be in the form of: example.com/products/category/<category slug>, then you don’t need to hook on term_link. Instead, you could just set the taxonomy’s rewrite slug to products/category and you would also register the taxonomy first then followed by the post type. That way, WordPress would see the request (at … Read more

How to update global variables in plugin activation callback?

Thanks to @Tom J Nowell’s help, I fixed my code to persist the created page ID to Options: function install_xxx() { $post = array( ‘post_title’ => __( ‘Thank You’, ‘xxx’ ), ‘post_content’ => __( ‘Lorem ipsum dolor.’, ‘xxx’ ), ‘post_status’ => ‘publish’, ‘post_name’ => ‘thank-you’, ‘post_type’ => ‘page’ ); $post_id = wp_insert_post( $post, true ); … Read more