Eliminate use of `extract()` in `trackback_url_list()`.
See #22400. Built from https://develop.svn.wordpress.org/trunk@28382 git-svn-id: http://core.svn.wordpress.org/trunk@28210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bee6492b9b
commit
ef8b813682
|
@ -3820,25 +3820,22 @@ function get_to_ping($post_id) {
|
|||
* @param string $tb_list Comma separated list of URLs
|
||||
* @param int $post_id Post ID
|
||||
*/
|
||||
function trackback_url_list($tb_list, $post_id) {
|
||||
function trackback_url_list( $tb_list, $post_id ) {
|
||||
if ( ! empty( $tb_list ) ) {
|
||||
// get post data
|
||||
$postdata = get_post($post_id, ARRAY_A);
|
||||
|
||||
// import postdata as variables
|
||||
extract($postdata, EXTR_SKIP);
|
||||
$postdata = get_post( $post_id, ARRAY_A );
|
||||
|
||||
// form an excerpt
|
||||
$excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);
|
||||
$excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content'] );
|
||||
|
||||
if (strlen($excerpt) > 255) {
|
||||
$excerpt = substr($excerpt,0,252) . '…';
|
||||
if ( strlen( $excerpt ) > 255 ) {
|
||||
$excerpt = substr( $excerpt, 0, 252 ) . '…';
|
||||
}
|
||||
|
||||
$trackback_urls = explode(',', $tb_list);
|
||||
foreach( (array) $trackback_urls as $tb_url) {
|
||||
$tb_url = trim($tb_url);
|
||||
trackback($tb_url, wp_unslash($post_title), $excerpt, $post_id);
|
||||
$trackback_urls = explode( ',', $tb_list );
|
||||
foreach( (array) $trackback_urls as $tb_url ) {
|
||||
$tb_url = trim( $tb_url );
|
||||
trackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue