Repository navigation
Commit bbd9fc3
committed
Code Modernization: Use the null coalescing operator in
The four object getters in `WP_Customize_Manager`: `get_setting()`, `get_panel()`, `get_section()`, and `get_control()`, each spell out an `isset()` guard followed by `return null`. The null coalescing operator says the same thing in one line.
`??` applies the same `isset()` semantics as the guard it replaces, and since the fallback here is `null` itself, both forms return the identical value in every case. This covers the complete set of same-shaped getters in the class.
Developed in WordPress#13304.
Follow-up to r63378.
Props Soean, mukesh27.
See #65818.
git-svn-id: https://develop.svn.wordpress.org/trunk@63411 602fd350-edb4-49c9-b593-d223f7449a82WP_Customize_Manager.1 parent ea95d00 commit bbd9fc3
1 file changed
Lines changed: 4 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3872 | 3872 | | |
3873 | 3873 | | |
3874 | 3874 | | |
3875 | | - | |
3876 | | - | |
3877 | | - | |
3878 | | - | |
3879 | | - | |
| 3875 | + | |
3880 | 3876 | | |
3881 | 3877 | | |
3882 | 3878 | | |
| |||
3926 | 3922 | | |
3927 | 3923 | | |
3928 | 3924 | | |
3929 | | - | |
3930 | | - | |
3931 | | - | |
3932 | | - | |
3933 | | - | |
| 3925 | + | |
3934 | 3926 | | |
3935 | 3927 | | |
3936 | 3928 | | |
| |||
4024 | 4016 | | |
4025 | 4017 | | |
4026 | 4018 | | |
4027 | | - | |
4028 | | - | |
4029 | | - | |
4030 | | - | |
4031 | | - | |
| 4019 | + | |
4032 | 4020 | | |
4033 | 4021 | | |
4034 | 4022 | | |
| |||
4105 | 4093 | | |
4106 | 4094 | | |
4107 | 4095 | | |
4108 | | - | |
4109 | | - | |
4110 | | - | |
4111 | | - | |
4112 | | - | |
| 4096 | + | |
4113 | 4097 | | |
4114 | 4098 | | |
4115 | 4099 | | |
| |||
0 commit comments