Codex tools: Log in
Contents |
Ensures a string is a valid SQL order by clause.
Accepts one or more columns, with or without ASC/DESC, and also accepts RAND().
<?php sanitize_sql_orderby( $orderby ); ?>
Since: 2.5.1
sanitize_sql_orderby() is located in /wp-includes/formatting.php.
sanitize_sql_orderby() is in a class of functions that help you sanitize potentially unsafe data which allow you to pass an arbitrary variable and receive the clean version based on data type. Others include: