twentyfourteen_sanitize_layout

Sanitize the Featured Content layout value.

Description

(string) twentyfourteen_sanitize_layout( (string) $layout ); 

Returns (string)

Filtered layout type (grid|slider).

Parameters (1)

0. $layout (string)
Layout type.

Usage

  1. if ( !function_exists( 'twentyfourteen_sanitize_layout' ) ) { 
  2. require_once '/inc/customizer.php'; 
  3.  
  4. // Layout type. 
  5. $layout = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentyfourteen_sanitize_layout($layout); 
  9.  

Defined (1)

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

/inc/customizer.php  
  1. function twentyfourteen_sanitize_layout( $layout ) { 
  2. if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) { 
  3. $layout = 'grid'; 
  4.  
  5. return $layout;