2015-07-01 83 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; 
} 
相关问题