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 ); ?>
sanitize_sql_orderby() is located in
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: