-
Notifications
You must be signed in to change notification settings - Fork 1
Using sanitation filters and methods
nadavrt edited this page May 28, 2015
·
8 revisions
In simple Meta Boxes creating a filter is as easy as creating a new method in sanitation-methods.php. There are three important rules when creating a new sanitation method:
- The name of the method must begin with sanitize_ because SMB uses this prefix to index its sanitation methods when it is instantiated.
- The method must accept a parameter that will hold the data to be sanitized (usually refered to as $data). SMB will automatically pass the required data to this parameter.
- The method must return the sanitized data, or else the data will be lost.