Hello,
it’s pretty cool that page headers now are post types and can therefore can be globally edited. However there is one thing that seems broken when used with wpml. When I make page_headers translateable, it shows all page headers in all languages in the dropdown and not only the page header for the selected language.
So I looked into it myself and found that when I disable suppress filters in the call to get_posts, I will only see the page headers available in the selected language. It is on line 709 in gp-premium/page-header/functions/metabox.php
$page_headers = get_posts(array(
'posts_per_page' => -1,
'orderby' => 'title',
'post_type' => 'generate_page_header',
// I added this line so the wpml filters can modify the query
'suppress_filters' => 0
));
Maybe you can add this as an option or do this by default? It would make sense to add this line if WPML is running. Thanks
Great!
I wouldn’t know if it would have any side effects (can not think of any), but if you want to be on the safe side, another possibility would be to run the query args through a filter we could hook into. I think you will know best what to do π
I will keep this thread open, as the issue is not really resolved yet.
I just realized that the same ‘issue’ applies to the global selection of page headers. Since you are doing it with suppress_filter in the layout meta box now, it would be consistent to have the same behaviour in the global location dropdown menus.