get_meta_keys(): string[]

In this article

Returns a list of previously defined keys.

Return

string[] Array of meta key names.

Source

function get_meta_keys() {
	global $wpdb;

	$keys = $wpdb->get_col(
		"SELECT meta_key
		FROM $wpdb->postmeta
		GROUP BY meta_key
		ORDER BY meta_key"
	);

	return $keys;
}

Changelog

VersionDescription
1.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.