WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/sanitize sql orderby"

(Created page with "== Description == Ensures a string is a valid SQL order by clause. Accepts one or more columns, with or without ASC/DESC, and also accepts RAND(). == Usage == <?php sanitize_s…")
(No difference)

Revision as of 16:06, 17 December 2012

Description

Ensures a string is a valid SQL order by clause.

Accepts one or more columns, with or without ASC/DESC, and also accepts RAND().

Usage

<?php sanitize_sql_orderby( $orderby ); ?>

Parameters

$orderby
(string) (required) Order by string to be checked.
Default: None

Return Values

(string | boolean) 
Returns the order by clause if it is a match, false otherwise.

Examples

Notes

Change Log

Since: 2.5.1

Source File

sanitize_sql_orderby() is located in /wp-includes/formatting.php.

Related Functions

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:

Related