backstretch_kill_switch

Description

This filter allow you to disable the images and javascript used for WP Backstretch on a specific post / page / category / etc using conditional tags. Where is the option inside the post meta area, but this may be useful for times when you don’t want those settings activated. This will override any settings.

Usage

Display on home page only

function rkv_killswitch_home() {

	if ( ! is_front_page() ) {
		return true;
	}

}

add_filter( 'backstretch_kill_switch', 'rkv_killswitch_home' );

Disable on a single page

function rkv_killswitch_about() {

	if ( is_page( 'about' ) ) {
		return true;
	}
}

add_filter( 'backstretch_kill_switch', 'rkv_killswitch_about' );

Disable site-wide

function rkv_killswitch_all() {

	return true;

}

add_filter( 'backstretch_kill_switch', 'rkv_killswitch_all' );

Disable on mobile devices

function rkv_killswitch_mobile() {

	if ( wp_is_mobile() ) {
		return true;
	}

}

add_filter( 'backstretch_kill_switch', 'rkv_killswitch_mobile' );