2015-07-01 124 views

回答

1

發現這似乎做一個解決方案:

function isPostThumbnail($imageId) { 
    $args = array(
    'post_type'  => 'post', 
    'posts_per_page' => 1, 
    'meta_query'  => array(
     array(
      'key'  => '_thumbnail_id', 
      'compare' => '=', 
      'value' => $imageId 
     ), 
    ) 
); 

    return sizeof(get_posts($args)) >0; 
} 
相關問題