qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
554 stars 105 forks source link

Don't show slug metabox on woo shop_orders and shop_coupon pages #1192

Closed erichk4 closed 2 years ago

erichk4 commented 2 years ago

The slug metaboxes might not be necessary for the woocommerce orders and coupon pages...

spleen1981 commented 2 years ago

Both postand post_type are not guaranteed to exist in $_GET, so they would need to be tested to avoid warnings. Also post_type seems not to be the right key to test in this case. Anyways global $post_type seems a cleaner test here. I think also that is better to move the logic inside the callback, there is no real advantage doing otherwise and readability is worst IMO. Also I think is better to have an array of "not applicable types" there, as I suspect others may come out. The above implemented here https://github.com/qtranslate/qtranslate-xt/pull/1192/commits/edcb9ac0fe38c69550e1e2d39c2edd0208c12609

@herrvigg as a side note these post types should not be translatable at all (ref. also #1116), we should check upstream and grey-up unchecked the relevant post types checkboxes in qtranslate advanced settings.