{"action":"closed","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/7427","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7427/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7427/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7427/events","html_url":"https://github.com/WordPress/gutenberg/issues/7427","id":334438853,"node_id":"MDU6SXNzdWUzMzQ0Mzg4NTM=","number":7427,"title":"wp_reset_query() in a block doesn't work","user":{"login":"manake","id":6874031,"node_id":"MDQ6VXNlcjY4NzQwMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/6874031?v=4","gravatar_id":"","url":"https://api.github.com/users/manake","html_url":"https://github.com/manake","followers_url":"https://api.github.com/users/manake/followers","following_url":"https://api.github.com/users/manake/following{/other_user}","gists_url":"https://api.github.com/users/manake/gists{/gist_id}","starred_url":"https://api.github.com/users/manake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manake/subscriptions","organizations_url":"https://api.github.com/users/manake/orgs","repos_url":"https://api.github.com/users/manake/repos","events_url":"https://api.github.com/users/manake/events{/privacy}","received_events_url":"https://api.github.com/users/manake/received_events","type":"User","site_admin":false},"labels":[{"id":546156315,"node_id":"MDU6TGFiZWw1NDYxNTYzMTU=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/Block%20API","name":"Block API","color":"fbca04","default":false},{"id":531680828,"node_id":"MDU6TGFiZWw1MzE2ODA4Mjg=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Question","name":"[Type] Question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-21T10:48:14Z","updated_at":"2018-08-21T17:25:21Z","closed_at":"2018-08-21T17:25:21Z","author_association":"NONE","body":"```\r\nfunction xxx() {\r\n\t$something = apply_filters( 'the_content', '<!-- wp:slug/something /-->' );\r\n}\r\nadd_action( 'admin_enqueue_scripts', 'xxx' );\r\n\r\nfunction render_callback_for_slug_something(){\r\n\t$recent = new WP_Query( $args );\r\n\r\n\twhile ( $recent->have_posts() ) {\r\n\t\t$recent->the_post();\r\n\t}\r\n\r\n\twp_reset_query();\r\n}\r\n```\r\n\r\nWith the above code present when I try to edit a `page` like:\r\nhttp://localhost/wp-admin/post.php?post=111&action=edit\r\n\r\nThen that URL redirects me to some other ID (of some `post`):\r\nhttp://localhost/wp-admin/post.php?post=222&action=edit\r\n\r\nIn other words `wp_reset_query();` didn't restore `$post`? How can I make a custom query in a PHP render callback?\r\n\r\nGutenberg 3.0.1"}}
{"actor":{"display_login":"obenland"}}