Summery Summery

Given a meta query, generates SQL clauses to be appended to a main query.

Syntax Syntax

get_meta_sql( array $meta_query, string $type, string $primary_table, string $primary_id_column, object $context = null )

Parameters Parameters


(array) (Required) A meta query.


(string) (Required) Type of meta.


(string) (Required) Primary database table name.


(string) (Required) Primary ID column name.


(object) (Optional) The main query object

Default value: null

Return Return

(array) Associative array of JOIN and WHERE SQL.

Source Source

File: wp-includes/meta.php

	$table = _get_meta_table( $meta_type );
	if ( ! $table ) {
		return false;


Changelog Changelog

Version Description
3.2.0 Introduced.

See also See also


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What are you looking for?