Commit Graph

11 Commits

Author SHA1 Message Date
Nestor Soriano cf9300bbbc
Refactor in the WC_Settings_Page class for PHP 8 compatibility
- Turn get_settings into a parameterless method, but accept one
  parameter via func_get_arg; and mark the method as deprecated.
- Rename the existing get_settings to get_settings_for_section;
  and mark the method as final.
- Rename the existing get_settings_for_section to get_settings_for_section_core.

See the comment added to get_settings for the rationale for the change.
2021-04-13 12:45:42 +02:00
Nestor Soriano 56cc063d7f
Rename "get_settings" to "get_settings_for_section" in settings pages.
In PHP 8 overriding a method having an optional parameter with a
method having no parameters throws an error, thus we can't use
the strategy of changing "get_settings()" to "get_settings($section='')"
without breaking existing extensions. So we do the following instead:

- Rename the existing "get_settings" to "get_settings_for_section"
- Rename the existing "get_settings_for_section" to "get_settings_for_section_core"
- Add a "get_settings" that just does "get_settings_for_section('')"
  for compatibility, but mark it as deprecated.
2021-04-12 18:04:41 +02:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Claudio Sanches 24cc589fd5 Fixed includes/class-wc-register-wp-admin-settings.php PHPCS violations 2018-03-21 00:16:26 -03:00
Mike Jolley 5770fb132e If The $object is not really an object, don't continue. It's invalid. 2017-04-05 11:10:27 +01:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Aristeides Stathopoulos 230c0398b3 fix failing test from master 2016-09-09 19:39:09 +03:00
Justin Shreve a36b25a68f Add setting validation to the REST API 2016-09-08 15:20:15 -07:00
Justin Shreve 49676d1781 Hook up email settings to the API
Add support for option_key when registering settings, so we can also manage settings that are stored in the array of a single option.
2016-09-08 15:20:15 -07:00
Aristeides Stathopoulos 39d4d4bd69 Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar 2016-09-02 05:40:36 +03:00
Justin Shreve 02915e6056 Rename helper class from 'legacy' to be more descriptive of whats happening. Registering wp-admin settings to the REST API. 2016-07-26 11:08:29 -07:00