Is this going to be fixed in an upcoming release?
I see this in edit-pages.php:
if (isset($user_ID) && (” != intval($user_ID))) {
$posts = $wpdb->get_results(“
SELECT $wpdb->posts.*, $wpdb->users.user_level FROM $wpdb->posts
INNER JOIN $wpdb->users ON ($wpdb->posts.post_author = $wpdb->users.ID)
WHERE $wpdb->posts.post_status = ‘static’
AND ($wpdb->users.user_level < $user_level OR $wpdb->posts.post_author = $user_ID)
“);
} else {
$posts = $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_status = ‘static'”);
}
Commenting out the first part and just setting $posts to the result of the simple query generates the expected results.
What I see that’s problematic is not in the query, but in the fact that WordPress sets the ??wner of the page to “site admin”. This appears to be a bug in edit-page-form.php, which isn’t correctly selecting the current signed-in user as the owner of the page when populating the “Owner” dropdown box. The result is that the page is created by user X but is set as owned by userid=1 (admin typically).