jetpack_load_infinite_scroll_annotation

Load theme's infinite scroll annotation file, if present in the IS plugin.

Description

(null) jetpack_load_infinite_scroll_annotation(); 

The setup_theme action is used because the annotation files should be using after_setup_theme to register support for IS.

As released in Jetpack 2.0, a child theme's parent wasn't checked for in the plugin's bundled support, hence the convoluted way the parent is checked for now.

Returns (null)


Usage

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

Defined (1)

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

/modules/theme-tools/infinite-scroll.php  
  1. function jetpack_load_infinite_scroll_annotation() { 
  2. if ( is_admin() && isset( $_GET['page'] ) && jetpack == $_GET['page'] ) { 
  3. $theme = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_theme( get_current_theme() ); 
  4.  
  5. if ( ! is_a( $theme, 'WP_Theme' ) && ! is_array( $theme ) ) 
  6. return; 
  7.  
  8. /** This filter is already documented in modules/infinite-scroll/infinity.php */ 
  9. $customization_file = apply_filters( 'infinite_scroll_customization_file', dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Stylesheet']}.php", $theme['Stylesheet'] ); 
  10.  
  11. if ( is_readable( $customization_file ) ) { 
  12. require_once( $customization_file ); 
  13. } elseif ( ! empty( $theme['Template'] ) ) { 
  14. $customization_file = dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Template']}.php"; 
  15.  
  16. if ( is_readable( $customization_file ) ) 
  17. require_once( $customization_file );