Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -2006,6 +2006,10 @@ |
2007 | 2007 | 'UserGetAllRights': after calculating a list of all available rights |
2008 | 2008 | &$rights: Array of rights, which may be added to. |
2009 | 2009 | |
| 2010 | +'UserGetDefaultOptions': after fetching the core default, this hook is ran |
| 2011 | +right before returning the options to the caller. |
| 2012 | +&$defaultOptions: Array of preference keys and their default values. |
| 2013 | + |
2010 | 2014 | 'UserGetEmail': called when getting an user email address |
2011 | 2015 | $user: User object |
2012 | 2016 | &$email: email, change this to override local email |
Index: trunk/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -211,6 +211,13 @@ |
212 | 212 | * New maintenance script to refresh image metadata (maintenance/refreshImageMetadata.php) |
213 | 213 | * (bug 30722) Add an identity collation that sorts things based on what the |
214 | 214 | unicode code point is (aka pre-1.17 behaviour) |
| 215 | +* (bug 30940) Add a hook in User:getDefaultOptions. |
| 216 | + To give extensions a better and more flexible way of providing default |
| 217 | + values for preferences a hook has been introdiced in User:getDefaultOptions(). |
| 218 | + Setting preferences in $wgDefaultUserOptions still work fine, but when reading |
| 219 | + them (i.e. with array_keys) to get a list of all preferences, then |
| 220 | + $wgDefaultUserOptions should no longer be used as it will contain those set via |
| 221 | + User:getDefaultOptions(). |
215 | 222 | |
216 | 223 | === Bug fixes in 1.18 === |
217 | 224 | * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php) |
Index: trunk/phase3/includes/User.php |
— | — | @@ -1214,6 +1214,8 @@ |
1215 | 1215 | } |
1216 | 1216 | $defOpt['skin'] = $wgDefaultSkin; |
1217 | 1217 | |
| 1218 | + wfRunHooks( 'UserGetDefaultOptions', array( &$defOpt ) ); |
| 1219 | + |
1218 | 1220 | return $defOpt; |
1219 | 1221 | } |
1220 | 1222 | |