Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Polylang #17

Open
timiwahalahti opened this issue Nov 15, 2018 · 2 comments
Open

Support Polylang #17

timiwahalahti opened this issue Nov 15, 2018 · 2 comments

Comments

@timiwahalahti
Copy link
Contributor

Hi! This is an amazing plugin which we use almost in every site, thanks!

There are a few things that are bugging me, related to compatibility with Polylang:

  • CPT archive page slugs need to be translated in Polylang "Strings translations" tool to exactly same as the translated archive page slug is. I'd like to find a robust solution for this, or at least give the user a reminder about this
  • menus do not get current-menu-item etc classes for translated archive pages, I have a small workaround for that to be put in filter_wp_nav_menu_objects function after $page_ids is set
if ( function_exists( 'pll_current_language' ) ) {
      if ( pll_current_language() !== pll_default_language() ) {
        foreach ( $page_ids as $tmp_page_id_key => $tmp_page_id ) {
          $page_ids[ $tmp_page_id_key ] = pll_get_post( $tmp_page_id );
        }
      }
    }

I'm wondering, do you accept PR's for this kind of compatibility issues or should I create a plugin for Polylang compatibility?

@timiwahalahti
Copy link
Contributor Author

Pining @roborourke, this little addition would make my life so much easier.

@roborourke
Copy link
Contributor

@timiwahalahti hey sorry, haven't looked at this repo in a while! I feel that generally I prefer to keep integrations with other plugins external but ensure that there are appropriate places to hook into to make it as easy as possible. The reason is just that I don't have much time to maintain projects like this and having to test a Polylang integration too would add to that.

I'd be more than happy to add a link to a separate Polylang integration plugin on the Readme however, and if there are certain filters / actions that would make it easier to build I'm happy to accept PRs to add them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants