Changeset 30139
- Timestamp:
- 11/01/2014 01:49:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r30138 r30139 5708 5708 $urltest = parse_url($pagelinkedto); 5709 5709 if ( $post_ID = url_to_postid($pagelinkedto) ) { 5710 $way = 'url_to_postid()';5710 // $way 5711 5711 } elseif ( isset( $urltest['path'] ) && preg_match('#p/[0-9]{1,}#', $urltest['path'], $match) ) { 5712 5712 // the path defines the post_ID (archives/p/XXXX) 5713 5713 $blah = explode('/', $match[0]); 5714 5714 $post_ID = (int) $blah[1]; 5715 $way = 'from the path';5716 5715 } elseif ( isset( $urltest['query'] ) && preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) { 5717 5716 // the querystring defines the post_ID (?p=XXXX) 5718 5717 $blah = explode('=', $match[0]); 5719 5718 $post_ID = (int) $blah[1]; 5720 $way = 'from the querystring';5721 5719 } elseif ( isset($urltest['fragment']) ) { 5722 5720 // an #anchor is there, it's either... … … 5724 5722 // ...an integer #XXXX (simplest case) 5725 5723 $post_ID = (int) $urltest['fragment']; 5726 $way = 'from the fragment (numeric)';5727 5724 } elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) { 5728 5725 // ...a post id in the form 'post-###' 5729 5726 $post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']); 5730 $way = 'from the fragment (post-###)';5731 5727 } elseif ( is_string($urltest['fragment']) ) { 5732 5728 // ...or a string #title, a little more complicated … … 5737 5733 return $this->pingback_error( 0, '' ); 5738 5734 } 5739 $way = 'from the fragment (title)';5740 5735 } 5741 5736 } else {
Note: See TracChangeset
for help on using the changeset viewer.