fsb_context_displayed

Found in /includes/display-image.php

This filter allows developers to adjust the page context that the plugin is working on. The data that is being filtered returns the type of page that the visitor is viewing. Those page contexts include:

  • category
  • archives
  • front (i.e. is_front_page())
  • blog (i.e. is_home())
  • pages
  • search
  • posts
  • 404
  • global

These contexts are used to retrieve the appropriate image(s) for the context the visitor is viewing.

This filter can be used, for example, to always show the front context’s background image on the blog page like this:

<code>add_filter( 'fsb_context_displayed', 'my_context_filter' ); 
function my_context_filter( $context ){
     if ( 'blog' == $context ){
         $context = 'front';
     }
     return $context; 
}

$context in the example is a string that outputs one of the contexts in the list above.

You can also use this to add your own custom context.