Deprecate make_url_footnote(). fixes #4968

git-svn-id: http://svn.automattic.com/wordpress/trunk@12203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-11-17 21:11:24 +00:00
parent 0334c59be2
commit d6bd539813
2 changed files with 30 additions and 28 deletions

View File

@ -1756,4 +1756,34 @@ function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file
echo $content; echo $content;
} }
/**
* Strip HTML and put links at the bottom of stripped content.
*
* Searches for all of the links, strips them out of the content, and places
* them at the bottom of the content with numbers.
*
* @since 0.71
* @deprecated 2.9.0
*
* @param string $content Content to get links
* @return string HTML stripped out of content with links at the bottom.
*/
function make_url_footnote( $content ) {
_deprecated_function(__FUNCTION__, '2.9', '' );
preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
$links_summary = "\n";
for ( $i=0; $i<count($matches[0]); $i++ ) {
$link_match = $matches[0][$i];
$link_number = '['.($i+1).']';
$link_url = $matches[2][$i];
$link_text = $matches[4][$i];
$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
$links_summary .= "\n" . $link_number . ' ' . $link_url;
}
$content = strip_tags( $content );
$content .= $links_summary;
return $content;
}
?> ?>

View File

@ -970,34 +970,6 @@ function maybe_serialize( $data ) {
return $data; return $data;
} }
/**
* Strip HTML and put links at the bottom of stripped content.
*
* Searches for all of the links, strips them out of the content, and places
* them at the bottom of the content with numbers.
*
* @since 0.71
*
* @param string $content Content to get links
* @return string HTML stripped out of content with links at the bottom.
*/
function make_url_footnote( $content ) {
preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
$links_summary = "\n";
for ( $i=0; $i<count($matches[0]); $i++ ) {
$link_match = $matches[0][$i];
$link_number = '['.($i+1).']';
$link_url = $matches[2][$i];
$link_text = $matches[4][$i];
$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
$links_summary .= "\n" . $link_number . ' ' . $link_url;
}
$content = strip_tags( $content );
$content .= $links_summary;
return $content;
}
/** /**
* Retrieve post title from XMLRPC XML. * Retrieve post title from XMLRPC XML.
* *