{"action":"closed","issue":{"url":"https://api.github.com/repos/polylang/polylang/issues/231","repository_url":"https://api.github.com/repos/polylang/polylang","labels_url":"https://api.github.com/repos/polylang/polylang/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/polylang/polylang/issues/231/comments","events_url":"https://api.github.com/repos/polylang/polylang/issues/231/events","html_url":"https://github.com/polylang/polylang/issues/231","id":303748225,"number":231,"title":"The number of posts of a post type are wrong when a languague is selected","user":{"login":"7studio","id":835430,"avatar_url":"https://avatars3.githubusercontent.com/u/835430?v=4","gravatar_id":"","url":"https://api.github.com/users/7studio","html_url":"https://github.com/7studio","followers_url":"https://api.github.com/users/7studio/followers","following_url":"https://api.github.com/users/7studio/following{/other_user}","gists_url":"https://api.github.com/users/7studio/gists{/gist_id}","starred_url":"https://api.github.com/users/7studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7studio/subscriptions","organizations_url":"https://api.github.com/users/7studio/orgs","repos_url":"https://api.github.com/users/7studio/repos","events_url":"https://api.github.com/users/7studio/events{/privacy}","received_events_url":"https://api.github.com/users/7studio/received_events","type":"User","site_admin":false},"labels":[{"id":364403018,"url":"https://api.github.com/repos/polylang/polylang/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-09T07:24:32Z","updated_at":"2018-03-15T14:13:19Z","closed_at":"2018-03-15T14:13:19Z","author_association":"NONE","body":"```\r\nWordPress version: 4.9.4\r\nPlugin version: Polylang Pro 2.3.2\r\n```\r\nHi,\r\n\r\nI run into an issue with Polylang when a list of items is displayed while a specific language is selected.\r\n\r\nAll number of posts for a post type in the list of views available are wrong.\r\nIt's the amount of all languagues which are displayed and not just the selected language (e.g. ; screenshot below)\r\n![bug-polylang-wp-count-posts](https://user-images.githubusercontent.com/835430/37195423-099083da-2373-11e8-9c19-8b65e524338d.png)\r\n\r\nIt seems that the problem comes from the function `wp_count_posts` there [wp-includes/post.php#L2321-L2389](https://github.com/WordPress/WordPress/blob/master/wp-includes/post.php#L2321-L2389).\r\n\r\nI don't know if using the filter `wp_count_posts` is the best solution but I haven't found anything else.\r\nI'm sorry but I haven't enough time to investigate more and submit a PR."}}
{"actor":{"display_login":"Chouby"}}