New Paste

 

Recent Pastes

Administrate




PageLines PasteBin.

PasteID: 9ym
Pasted by Evan, 2012-11-23 04:27:09 GMT
Expires Never
Paste size 1.13 Kb
Toggle Expand   Wrap   Raw
Copy Contents   Copy URL
 
  1. /**
  2.  * is_pagelines_special() REVISED
  3.  *
  4.  * A few conditional functions that were being used were unnecessary
  5.  * (is_author, is_category, & is_tag) as these are all covered by is_archive
  6.  * 
  7.  * $special_types should be a filterable array to allow ploption to be used for extended special option values,
  8.  * or anytime the passed $args['type'] would be used/compared (in admin)
  9.  * 
  10.  * Filterable return value - could be used for example to return false for the blog home,
  11.  * letting the page meta values take precedence instead of the special.  Just a thought.
  12.  *
  13.  */
  14. function is_pagelines_special( $args = array() ) {
  15.  
  16. 	$special_types = apply_filters( 'pagelines_special_types', array('posts','archive','category','search','tag','author','404_page') );
  17.  
  18. 	if ( is_404() || is_home() || is_search() || is_archive() || pl_is_cpt() ) 
  19. 		$special = true;
  20.  
  21. 	elseif ( isset( $args['type'] ) && in_array( $args['type'], $special_types ) )		   
  22. 		$special = true;
  23.  
  24. 	elseif ( pl_is_integration() )
  25. 		$special = true;
  26.  
  27. 	else 
  28. 		$special = false;
  29.  
  30. 	return apply_filters( 'is_pagelines_special', $special, $args );
  31. }
 
 
 

 
 
 
 
 
Written by Xan Manning, 2010.
YOU NEED FLASH!