﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
14382	extra pages loading unnecessarily	zengy		"I have a WP3 issue that I came across and I thought it should be posted here. I apologize if this has been posted previously. Please let me know if this issue exists as a current known bug.

I am coding a plugin that needs to do something on 'wp_head'. I was noticing that it was executing my code twice. I am now using error_log() to display the post ID and it is displaying the ID of the page I am loading plus another page ID.

This only happens when loading pages that have subpages associated with them. This bug occurs when a custom permalink structure is chosen. It does not happen when using the default permalink structure.

Here are steps to reproduce this issue:

1) Create a new WP3 site and create a .htaccess file.

2) Install and activate this plugin:

{{{
<?php

/*
* Plugin Name: Post ID Test
*/

function display_post_id() {
	global $post;
	error_log('post id: ' . $post->ID . ' | post title: ' . $post->post_title);
}

add_action('wp_head', 'display_post_id');

?>
}}}

3) Create the following page hierarchy:

{{{
Page 1
  Page 1.1
  Page 1.2
Page 2
}}}

4) Change the permalink settings to ""Day and Name"".

5) Visit the front end for Page 2. Your error log will be something like this:

{{{
	[21-Jul-2010 19:59:04] post id: 10 | post title: Page 2
}}}

6) Now visit the front end for Page 1. Your error log will be something like this:

{{{
	[21-Jul-2010 20:00:46] post id: 4 | post title: Page 1
	[21-Jul-2010 20:00:47] post id: 6 | post title: Page 1.1
}}}

7) Page 1.1 generates the following:

{{{
	[21-Jul-2010 20:00:58] post id: 6 | post title: Page 1.1
	[21-Jul-2010 20:00:58] post id: 8 | post title: Page 1.2
}}}	

I tried this in W 2.9.2 and the issue does not exist.
"	defect (bug)	closed	normal		Rewrite Rules	3.0	major	invalid	regression	zengy eric@… prodevstudio+wordpress@… frederick.ding@…
