Quantcast
Channel: Ruben Sargsyan » WordPress
Viewing all articles
Browse latest Browse all 16

Get user added custom fields in WordPress

$
0
0

A short code to get all user added custom fields in WordPress:

<?php
$custom_fields = $wpdb->get_col("SELECT meta_key FROM $wpdb->postmeta GROUP BY meta_key	HAVING meta_key NOT LIKE '\_%' ORDER BY meta_key");
natcasesort($custom_fields);
?>

Viewing all articles
Browse latest Browse all 16

Trending Articles