slug; $i++; } $cats[$category->slug] = $category->name; } if ( array_key_exists( $input, $cats ) ){ return $input; } } /** * Validates layout input */ function igthemes_sanitize_layout( $input) { $valid = array( '1col' => '1col', '2cl' => '2cl', '2cr' => '2cr', ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } /** * Sanitize a color represented in hexidecimal notation. */ function igthemes_sanitize_hex( $input ) { $hex = sanitize_hex_color( $input ); return $hex; }