jetpack_load_theme_compat

Load theme compat file if it exists.

Description

jetpack_load_theme_compat(); 

Usage

  1. if ( !function_exists( 'jetpack_load_theme_compat' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/theme-tools.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_load_theme_compat(); 
  7.  

Defined (1)

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

/modules/theme-tools.php  
  1. function jetpack_load_theme_compat() { 
  2.  
  3. /** 
  4. * Filter theme compat files. 
  5. * Themes can add their own compat files here if they like. For example: 
  6. * add_filter( 'jetpack_theme_compat_files', 'mytheme_jetpack_compat_file' ); 
  7. * function mytheme_jetpack_compat_file( $files ) { 
  8. * $files['mytheme'] = locate_template( 'jetpack-compat.php' ); 
  9. * return $files; 
  10. * } 
  11. * @module theme-tools 
  12. * @since 2.8.0 
  13. * @param array Associative array of theme compat files to load. 
  14. */ 
  15. $compat_files = apply_filters( 'jetpack_theme_compat_files', array( 
  16. 'twentyfourteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfourteen.php',  
  17. 'twentyfifteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfifteen.php',  
  18. ) ); 
  19.  
  20. _jetpack_require_compat_file( get_stylesheet(), $compat_files ); 
  21.  
  22. if ( is_child_theme() ) { 
  23. _jetpack_require_compat_file( get_template(), $compat_files );