infinite_scroll_additional_stylesheets

Filter the additional styles required by the latest set of IS posts.

Description

apply_filters( 'infinite_scroll_additional_stylesheets', (array) $results_styles, (array|bool) $initial_styles, (array) $results, (array) $query_args, (WP_Query) $wp_query ); 

Parameters (5)

0. $results_styles (array)
Additional styles required by the latest set of IS posts.
1. $initial_styles (array|bool)
Set of styles loaded on each page.
2. $results (array)
Array of Infinite Scroll results.
3. $query_args (array)
Array of Query arguments.
4. $wp_query (WP_Query)
The wp query.

Usage

To run the hook, copy the example below.
  1. $results_styles = apply_filters( 'infinite_scroll_additional_stylesheets', $results_styles, $initial_styles, $results, $query_args, $wp_query ); 
  2.  
  3. if ( !empty( $results_styles ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the infinite_scroll_additional_stylesheets callback 
  2. function filter_infinite_scroll_additional_stylesheets( $results_styles, $initial_styles, $results, $query_args, $wp_query ) { 
  3. // make filter magic happen here... 
  4. return $results_styles
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'infinite_scroll_additional_stylesheets', 'filter_infinite_scroll_additional_stylesheets', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'infinite_scroll_additional_stylesheets', 'filter_infinite_scroll_additional_stylesheets', 10, 5 ); 

Defined (1)

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

/modules/infinite-scroll/infinity.php  
  1. $results['styles'] = apply_filters(