jetpack_featured_images_remove_post_thumbnail

The function to prevent for Featured Images to be displayed in a theme.

Description

jetpack_featured_images_remove_post_thumbnail( $metadata, $object_id, $meta_key, $single ); 

Parameters (4)

0. $metadata
The metadata.
1. $object_id
The object id.
2. $meta_key
The meta key.
3. $single
The single.

Usage

  1. if ( !function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) { 
  2. require_once '/modules/theme-tools/content-options/featured-images.php'; 
  3.  
  4. // The metadata. 
  5. $metadata = null; 
  6.  
  7. // The object id. 
  8. $object_id = null; 
  9.  
  10. // The meta key. 
  11. $meta_key = null; 
  12.  
  13. // The single. 
  14. $single = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = jetpack_featured_images_remove_post_thumbnail($metadata, $object_id, $meta_key, $single); 
  18.  

Defined (1)

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

/modules/theme-tools/content-options/featured-images.php  
  1. function jetpack_featured_images_remove_post_thumbnail( $metadata, $object_id, $meta_key, $single ) { 
  2. $opts = jetpack_featured_images_get_settings(); 
  3.  
  4. // Returns false if the archive option or singular option is unticked. 
  5. if ( ( true === $opts['archive'] && ( is_home() || is_archive() || is_search() ) && ! $opts['archive-option'] && ( isset( $meta_key ) && '_thumbnail_id' === $meta_key ) && in_the_loop() ) 
  6. || ( true === $opts['post'] && is_single() && ! $opts['post-option'] && ( isset( $meta_key ) && '_thumbnail_id' === $meta_key ) && in_the_loop() ) 
  7. || ( true === $opts['page'] && is_singular() && is_page() && ! $opts['page-option'] && ( isset( $meta_key ) && '_thumbnail_id' === $meta_key ) && in_the_loop() ) ) { 
  8. return false; 
  9. } else { 
  10. return $metadata;