Changeset 44546 for trunk/src/wp-includes/functions.php
- Timestamp:
- 01/10/2019 09:05:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r44506 r44546 3824 3824 3825 3825 /** 3826 * Cleans up an array, comma- or space-separated list of scalar values. 3827 * 3828 * @since 5.1.0 3829 * 3830 * @param array|string $list List of values. 3831 * @return array Sanitized array of values. 3832 */ 3833 function wp_parse_list( $list ) { 3834 if ( ! is_array( $list ) ) { 3835 return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY ); 3836 } 3837 3838 return $list; 3839 } 3840 3841 /** 3826 3842 * Clean up an array, comma- or space-separated list of IDs. 3827 3843 * … … 3832 3848 */ 3833 3849 function wp_parse_id_list( $list ) { 3834 if ( ! is_array( $list ) ) { 3835 $list = preg_split( '/[\s,]+/', $list ); 3836 } 3850 $list = wp_parse_list( $list ); 3837 3851 3838 3852 return array_unique( array_map( 'absint', $list ) ); … … 3848 3862 */ 3849 3863 function wp_parse_slug_list( $list ) { 3850 if ( ! is_array( $list ) ) { 3851 $list = preg_split( '/[\s,]+/', $list ); 3852 } 3853 3854 foreach ( $list as $key => $value ) { 3855 $list[ $key ] = sanitize_title( $value ); 3856 } 3857 3858 return array_unique( $list ); 3864 $list = wp_parse_list( $list ); 3865 3866 return array_unique( array_map( 'sanitize_title', $list ) ); 3859 3867 } 3860 3868
Note: See TracChangeset
for help on using the changeset viewer.