WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#4103 closed defect (bug) (worksforme)

Pingbacks don't always work on (sub) pages // error in function url_to_postid

Reported by: Michael_ Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1.3
Component: General Keywords:
Focuses: Cc:

Description

Pingbacks do not always work on pages. A pingback to site.com/test-page-1/ does work however e.g. a pingback to http://sw-guide.de/wordpress/wordpress-plugins/simple-tagging-plugin/ does not work. I could duplicate this issue several times using different sub pages.

I've found out that the url_to_postid() causes this problem.

Solution for WP 2.1.3: go to /wp-includes/rewrite.php, line # 143 and replace

return 0;

with

$query = new WP_Query('pagename=' . $request);
if ( $query->is_page )
	return $query->post->ID;
return 0;

See also wordpress.org forum post.

Change History (6)

#1 @Nazgul
12 years ago

  • Milestone set to 2.4 (future)

#2 @xorax
12 years ago

the way is to add at line # 128

$request_match = $request;

before

if ( (! empty($url)) && (strpos($match, $url) === 0) ) {
	$request_match = $url . '/' . $request;
}

and remove line # 124

$request_match = $request;

#3 @markjaquith
12 years ago

url_to_postid() works fine for me on child pages in trunk. Is this still an issue for 2.3?

#4 @xorax
12 years ago

humm right... and my change is bad because will not work any more on sub pages.
But url_to_postid not work on the "root" pages for me on 2.2.1 and 2.3...
wtf!

#5 @thee17
11 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#6 @thee17
11 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.