We can do this by storing the value into postmeta when post is published first time.
function save_ispublished( $post_id ) {
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
$published_once = get_post_meta( $post_id, 'is_published', true );
// Check if 'is_published' meta value is empty.
if ( ! empty( $published_once ) ) {
$published_once="yes";
}
// store is_published value when first time published.
update_post_meta( $post_id, 'is_published', $published_once );
}
add_action( 'save_post', 'save_ispublished' );
you can check it by get the meta value.
$is_published = get_post_meta( $post_id, 'is_published', true );
if( $is_published == 'yes' ) {
/*
* Actions if post is already published atleast once.
*/
}
Hope this help !