Skip to content

Commit

Permalink
Use a loop instead of array_reduce() for PHP 5.2 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brady Vercher authored and Brady Vercher committed Jan 25, 2015
1 parent e8c78f6 commit 8f12d07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/class-simple-image-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,10 @@ protected function siw_field_class( $id ) {
* @return string
*/
protected function siw_get_cache_key() {
$data = array_reduce( func_get_args(), 'array_merge', array() );
$data = array();
foreach ( func_get_args() as $arg ) {
$data = array_merge( $data, (array) $arg );
}
ksort( $data );
return 'siw_' . md5( json_encode( $data ) );
}
Expand Down

0 comments on commit 8f12d07

Please sign in to comment.