Last active
July 5, 2019 20:04
-
-
Save isotrope/a816df6c1206c5a6039d79b65a7b9dd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$postmeta_to_compile = 'some_field'; | |
$unique_values = $wpdb->get_col( | |
$wpdb->prepare( | |
"SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key=%s", | |
$postmeta_to_compile | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment