+ /**
+ * @inheritdoc
+ */
+ protected function transformFilterDefinition( array $filterDefinition ) {
+ if ( isset( $filterDefinition['showHideSuffix'] ) ) {
+ $filterDefinition['showHide'] = 'wl' . $filterDefinition['showHideSuffix'];
+ }
+
+ return $filterDefinition;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ protected function registerFilters() {
+ parent::registerFilters();
+
+ $user = $this->getUser();
+
+ $significance = $this->getFilterGroup( 'significance' );
+ $hideMinor = $significance->getFilter( 'hideminor' );
+ $hideMinor->setDefault( $user->getBoolOption( 'watchlisthideminor' ) );
+
+ $automated = $this->getFilterGroup( 'automated' );
+ $hideBots = $automated->getFilter( 'hidebots' );
+ $hideBots->setDefault( $user->getBoolOption( 'watchlisthidebots' ) );
+
+ $registration = $this->getFilterGroup( 'registration' );
+ $hideAnons = $registration->getFilter( 'hideanons' );
+ $hideAnons->setDefault( $user->getBoolOption( 'watchlisthideanons' ) );
+ $hideLiu = $registration->getFilter( 'hideliu' );
+ $hideLiu->setDefault( $user->getBoolOption( 'watchlisthideliu' ) );
+
+ $reviewStatus = $this->getFilterGroup( 'reviewStatus' );
+ if ( $reviewStatus !== null ) {
+ // Conditional on feature being available and rights
+ $hidePatrolled = $reviewStatus->getFilter( 'hidepatrolled' );
+ $hidePatrolled->setDefault( $user->getBoolOption( 'watchlisthidepatrolled' ) );
+ }
+
+ $authorship = $this->getFilterGroup( 'authorship' );
+ $hideMyself = $authorship->getFilter( 'hidemyself' );
+ $hideMyself->setDefault( $user->getBoolOption( 'watchlisthideown' ) );
+
+ $changeType = $this->getFilterGroup( 'changeType' );
+ $hideCategorization = $changeType->getFilter( 'hidecategorization' );
+ if ( $hideCategorization !== null ) {
+ // Conditional on feature being available
+ $hideCategorization->setDefault( $user->getBoolOption( 'watchlisthidecategorization' ) );
+ }
+ }
+