videopress_is_attachment_without_guid

Check to see if this is a VideoPress post that hasn't had a guid set yet.

Description

videopress_is_attachment_without_guid( (int) $post_id ); 

Parameters (1)

0. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( 'videopress_is_attachment_without_guid' ) ) { 
  2. require_once '/modules/videopress/utility-functions.php'; 
  3.  
  4. // The post id. 
  5. $post_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = videopress_is_attachment_without_guid($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/videopress/utility-functions.php  
  1. function videopress_is_attachment_without_guid( $post_id ) { 
  2. $post = get_post( $post_id ); 
  3.  
  4. if ( is_wp_error( $post ) ) { 
  5. return false; 
  6.  
  7. if ( $post->post_mime_type !== 'video/videopress' ) { 
  8. return false; 
  9.  
  10. $videopress_guid = get_post_meta( $post_id, 'videopress_guid', true ); 
  11.  
  12. if ( $videopress_guid ) { 
  13. return false; 
  14.  
  15. return true;