WordPress.org

Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#837 closed defect (invalid)

register_setting() page incorrectly refers to sanitization instead of validation

Reported by: McGuive7 Owned by:
Milestone: Priority: low
Component: Codex Keywords: needs-patch
Cc:

Description

The .org page for register_setting() (http://codex.wordpress.org/Function_Reference/register_setting) refers to the third parameter as $sanitize_callback, however in truth what this callback does is actually validation. The parameter should be listed as $validation_callback IMO.

Note: this is also present on the following page: http://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_setting

Change History (2)

#1 @samuelsidler
5 years ago

The Codex is a wiki. Anyone can edit it.

However, you should really look at developer.wordpress.org/reference, which is the official code reference. If there are errors there, they need to get fixed in the inline documentation, which you can do by filing a ticket in the core trac.

#2 @Otto42
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Additionally, this parameter is called "sanitize_callback" in the actual WordPress source code. The name is not chosen arbitrarily on the wiki page or in the documentation.

While I agree that the difference between "sanitization" and "validation" is a subtle one, this is what the code uses and how it defines it, therefore it should be documented as such.

Note: See TracTickets for help on using tickets.