Allow preferences that need not be rendered in Special:Preferences
[lhc/web/wiklou.git] / includes / Preferences.php
index 9a10867..e41fbc0 100644 (file)
@@ -1240,6 +1240,13 @@ class Preferences {
                        $formDescriptor = array_diff_key( $formDescriptor, $removeKeys );
                }
 
+               // Remove type=api preferences. They are not intended for rendering in the form.
+               foreach ( $formDescriptor as $name => $info ) {
+                       if ( isset( $info['type'] ) && $info['type'] === 'api' ) {
+                               unset( $formDescriptor[$name] );
+                       }
+               }
+
                /**
                 * @var $htmlForm PreferencesForm
                 */
@@ -1326,7 +1333,7 @@ class Preferences {
         * @param $alldata
         * @return int
         */
-       static function filterIntval( $value, $alldata ){
+       static function filterIntval( $value, $alldata ) {
                return intval( $value );
        }