{"action":"created","issue":{"url":"https://api.github.com/repos/oceanwp/oceanwp/issues/42","repository_url":"https://api.github.com/repos/oceanwp/oceanwp","labels_url":"https://api.github.com/repos/oceanwp/oceanwp/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/oceanwp/oceanwp/issues/42/comments","events_url":"https://api.github.com/repos/oceanwp/oceanwp/issues/42/events","html_url":"https://github.com/oceanwp/oceanwp/issues/42","id":292781438,"number":42,"title":"Compatibility with Polylang (templates in the customizer)","user":{"login":"nicomollet","id":108828,"avatar_url":"https://avatars1.githubusercontent.com/u/108828?v=4","gravatar_id":"","url":"https://api.github.com/users/nicomollet","html_url":"https://github.com/nicomollet","followers_url":"https://api.github.com/users/nicomollet/followers","following_url":"https://api.github.com/users/nicomollet/following{/other_user}","gists_url":"https://api.github.com/users/nicomollet/gists{/gist_id}","starred_url":"https://api.github.com/users/nicomollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicomollet/subscriptions","organizations_url":"https://api.github.com/users/nicomollet/orgs","repos_url":"https://api.github.com/users/nicomollet/repos","events_url":"https://api.github.com/users/nicomollet/events{/privacy}","received_events_url":"https://api.github.com/users/nicomollet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-01-30T13:24:59Z","updated_at":"2018-02-13T14:32:51Z","closed_at":"2018-02-02T09:50:56Z","author_association":"NONE","body":"Hello again,\r\n\r\nI am working with Ocean and Polylang. (Not a fan of WPML...)\r\n\r\nI see you already registered string for Polylang, it works as expected.\r\n\r\nThe problem I have, is with OceanWP templates selected in the customizer. For example, all the theme mods like `ocean_footer_widgets_template`.\r\n\r\n## How to reproduce ##\r\n\r\nIn the customizer, I select my \"Footer FR\" template for the field `ocean_footer_widgets_template`.\r\n![Image](https://i.imgur.com/Myzqn8G.png)\r\n\r\nWith Polylang, I translated the \"Footer FR\" into a \"Footer EN\".\r\n![Image](https://i.imgur.com/TPISb0P.png)\r\n\r\nI expected that \"Footer EN\" template would show up in my english version of the website, instead of the french template.\r\n\r\n## Suggestion ##\r\nIn https://github.com/oceanwp/oceanwp/blob/master/inc/helpers.php#L3789 you could do as:\r\n\r\n```php\r\nfunction oceanwp_footer_template_content() {\r\n\r\n\t// Return false if disabled via Customizer\r\n\tif ( true != get_theme_mod( 'ocean_footer_widgets', true ) ) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t// Get template ID from Customizer\r\n\t$content = get_theme_mod( 'ocean_footer_widgets_template' );\r\n\r\n\t// Get Polylang Translation of template\r\n\tif( function_exists('pll_get_post') ){\r\n\t\t$content = pll_get_post($content, pll_current_language());\r\n\t}\r\n\r\n\t// Get template content\r\n\tif ( ! empty( $content ) ) {\r\n\r\n\t\t$template = get_post( $content );\r\n\r\n\t\tif ( $template && ! is_wp_error( $template ) ) {\r\n\t\t\t$content = $template->post_content;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Apply filters and return content\r\n\treturn apply_filters( 'ocean_footer_template_content', $content );\r\n\r\n}\r\n\r\n```\r\n\r\nThe other theme also need to be translated:\r\nocean_top_bar_template\r\nocean_top_bar_social_alt_template\r\nocean_vertical_header_template\r\nocean_vertical_header_bottom_template\r\nocean_header_template\r\nocean_menu_social_template\r\nocean_footer_widgets_template\r\nocean_error_page_template\r\n\r\nSince you already partially support Polylang, it would be nice to have a complete compatibility.\r\nKind regards\r\nNico"},"comment":{"url":"https://api.github.com/repos/oceanwp/oceanwp/issues/comments/365283867","html_url":"https://github.com/oceanwp/oceanwp/issues/42#issuecomment-365283867","issue_url":"https://api.github.com/repos/oceanwp/oceanwp/issues/42","id":365283867,"user":{"login":"nicolas-owp","id":32877254,"avatar_url":"https://avatars3.githubusercontent.com/u/32877254?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-owp","html_url":"https://github.com/nicolas-owp","followers_url":"https://api.github.com/users/nicolas-owp/followers","following_url":"https://api.github.com/users/nicolas-owp/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-owp/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-owp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-owp/subscriptions","organizations_url":"https://api.github.com/users/nicolas-owp/orgs","repos_url":"https://api.github.com/users/nicolas-owp/repos","events_url":"https://api.github.com/users/nicolas-owp/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-owp/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T14:32:51Z","updated_at":"2018-02-13T14:32:51Z","author_association":"CONTRIBUTOR","body":"Thanks."}}
{"actor":{"display_login":"nicolas-owp"}}