← All changes
|
jetpack_vendor/automattic/jetpack-sync/src/class-modules.php
+4
-1
13.5.2
→
16.3-a.7
View file →
| @@ -112,8 +112,9 @@ | ||
| 112 | 112 | * |
| 113 | 113 | * @return array |
| 114 | 114 | */ |
| 115 | 115 | public static function initialize_modules() { |
| 116 | + | |
| 116 | 117 | /** |
| 117 | 118 | * Filters the list of class names of sync modules. |
| 118 | 119 | * If you add to this list, make sure any classes implement the |
| 119 | 120 | * Jetpack_Sync_Module interface. |
| @@ -122,10 +123,12 @@ | ||
| 122 | 123 | * @since-jetpack 4.2.0 |
| 123 | 124 | */ |
| 124 | 125 | $modules = apply_filters( 'jetpack_sync_modules', self::DEFAULT_SYNC_MODULES ); |
| 125 | 126 | |
| 127 | + // Exact class duplicates keep the position of their first contribution. | |
| 128 | + $modules = array_unique( $modules ); | |
| 129 | + | |
| 126 | 130 | $modules = array_map( array( __CLASS__, 'load_module' ), $modules ); |
| 127 | - | |
| 128 | 131 | return array_map( array( __CLASS__, 'set_module_defaults' ), $modules ); |
| 129 | 132 | } |
| 130 | 133 | |
| 131 | 134 | /** |