2017-02-23 11 views
0
$authors = $newsitem->get_item_authors(); 
     if(!empty($authors)){ 
      $facebook_author .= ',' .get_user_meta($authors[0]->ID, 'eco_author_social_profile', true); 
     } 

FB共有に複数の著者をCONCATしようとFB記事を共有

答えて

1

に倍数の作者をCONCATしようとすると、あなたはまた、あなたのコード

でこれを行うことができ破

<?php 

$authors = $newsitem->get_item_authors(); 
$facebook_authors = array() 
if(!empty($authors)){ 
    $facebook_authors[] = get_user_meta($authors[0]->ID, 'eco_author_social_profile', true); 
} 
$facebook_author = implode(",", $facebook_authors); 

?> 

で試すことができます

$authors = $newsitem->get_item_authors(); 
if(!empty($authors)){ 
    $facebook_author .= ',' .get_user_meta($authors[0]->ID, 'eco_author_social_profile', true); 
} 
$facebook_author = ltrim($facebook_author, ","); 
関連する問題