Eliminate use of `extract()` in `trackback_url_list()`.
See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28382 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
671b47ef73
commit
42d6b5dd1e
|
@ -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