Random WordPress Function

Learn about a new WordPress function every day!


Function Signature:

wp_kses_array_lc

Function Description:

Converts the keys of an array to lowercase.

Function Examples:

⚠️ Examples below are generated with GPT-3 once every hour. Do not take them too seriously.
Consider them as some extra input in your learning process - reason about them. Will it work? What could fail?
// Example 1: Basic usage of wp_kses_array_lc to sanitize an array of strings
$dirty_array = array( 'Hello', '', 'World' );
$sanitized_array = wp_kses_array_lc( $dirty_array );
// Output: array( 'Hello', 'World' )
// Example 2: Using wp_kses_array_lc to sanitize an array of URLs
$dirty_urls = array( 'https://example.com', 'javascript:alert("XSS Attack!")', 'ftp://example.com' );
$sanitized_urls = wp_kses_array_lc( $dirty_urls, 'url' );
// Output: array( 'https://example.com', '', 'ftp://example.com' )
// Example 3: Handling an array with mixed data types using wp_kses_array_lc
$dirty_data = array( 'John Doe', 25, 'Some bold text', array( 'nested', '' ) );
$sanitized_data = wp_kses_array_lc( $dirty_data );
// Output: array( 'John Doe', 25, 'Some bold text', array( 'nested', '' ) )