Changeset 1282510
- Timestamp:
- 11/09/2015 12:59:50 PM (10 years ago)
- Location:
- awesome-photo-gallery/trunk/core
- Files:
-
- 2 edited
-
class-updater.php (modified) (1 diff)
-
class-viewer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
awesome-photo-gallery/trunk/core/class-updater.php
r1282502 r1282510 56 56 } 57 57 58 foreach ( $this->licenses as $addon => $license ) { 59 if ( $license['status'] != 'active' ) { 60 // License is inactive, skip this one. 61 continue; 62 } 58 if( is_array( $this->licenses ) ) { 59 foreach ( $this->licenses as $addon => $license ) { 60 if ( $license['status'] != 'active' ) { 61 // License is inactive, skip this one. 62 continue; 63 } 63 64 64 if ( isset( $this->extensions[ $addon ]['metadata']['version'] ) ) { 65 $this->check_addon_update( $addon, $license['key'], $this->extensions[ $addon ]['metadata']['version'] ); 65 if ( isset( $this->extensions[ $addon ]['metadata']['version'] ) ) { 66 $this->check_addon_update( $addon, $license['key'], $this->extensions[ $addon ]['metadata']['version'] ); 67 } 66 68 } 67 69 } -
awesome-photo-gallery/trunk/core/class-viewer.php
r1282502 r1282510 26 26 27 27 if( isset( $stored_value ) && ! empty( $stored_value ) ) { 28 $photo_index = array_flip( array_column( $media['photos'], 'id' ) );28 $photo_index = array_flip( $this->arrayColumn( $media['photos'], 'id' ) ); 29 29 $stored_value = explode( ',', $stored_value ); 30 30 … … 55 55 } 56 56 57 /** 58 * Fallback for array column 59 * 60 * @param array $array 61 * @param $column_key 62 * @param null $index_key 63 * 64 * @return array 65 */ 66 protected function arrayColumn( array $array, $column_key, $index_key = null ) { 67 if ( function_exists( 'array_column ' ) ) { 68 return array_column( $array, $column_key, $index_key ); 69 } 70 $result = [ ]; 71 foreach ( $array as $arr ) { 72 if ( ! is_array( $arr ) ) { 73 continue; 74 } 75 76 if ( is_null( $column_key ) ) { 77 $value = $arr; 78 } else { 79 $value = $arr[ $column_key ]; 80 } 81 82 if ( ! is_null( $index_key ) ) { 83 $key = $arr[ $index_key ]; 84 $result[ $key ] = $value; 85 } else { 86 $result[] = $value; 87 } 88 89 } 90 91 return $result; 92 } 93 57 94 }
Note: See TracChangeset
for help on using the changeset viewer.