- This topic has 8 replies, 2 voices, and was last updated 3 years ago by Enrico.
January 22, 2018 at 12:38 am #476822Enrico
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.GeneratePress 2.0.2GP Premium 1.5.6January 22, 2018 at 11:51 am #477380TomLead DeveloperLead Developer
In the select box inside the Layout metabox? That may just be the way it’s set up. Have you checked with them? Their support team is awesome 🙂January 22, 2018 at 8:34 pm #477663Enrico
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. ThanksJanuary 23, 2018 at 10:16 pm #478524TomLead DeveloperLead Developer
Very interesting – thanks for tracking that down for me! I’ll do some testing and will likely get it added to the next version.January 24, 2018 at 12:02 am #478585Enrico
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.January 24, 2018 at 3:30 pm #479231TomLead DeveloperLead DeveloperMay 4, 2018 at 2:21 am #567112Enrico
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.May 4, 2018 at 8:16 pm #567888TomLead DeveloperLead DeveloperMay 6, 2018 at 8:19 pm #569237Enrico
- You must be logged in to reply to this topic.