Closed erichk4 closed 2 years ago
Both post
and 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.
The slug metaboxes might not be necessary for the woocommerce orders and coupon pages...