- This topic has 8 replies, 2 voices, and was last updated 4 years, 1 month ago by
Enrico.
-
AuthorPosts
-
January 22, 2018 at 12:38 am #476822
Enrico
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.GeneratePress 2.0.2GP Premium 1.5.6January 22, 2018 at 11:51 am #477380Tom
Lead DeveloperLead DeveloperHi there,
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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 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. Thanks
January 23, 2018 at 10:16 pm #478524Tom
Lead DeveloperLead DeveloperVery interesting – thanks for tracking that down for me! I’ll do some testing and will likely get it added to the next version.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 24, 2018 at 12:02 am #478585Enrico
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.January 24, 2018 at 3:30 pm #479231Tom
Lead DeveloperLead DeveloperLooks good to me – I’ve made the change in GPP 1.6.
Thank you! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 4, 2018 at 2:21 am #567112Enrico
Hello,
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 #567888Tom
Lead DeveloperLead DeveloperDone – should be good to go in 1.6.3.
Thanks!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMay 6, 2018 at 8:19 pm #569237Enrico
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.