Skip to content

Instantly share code, notes, and snippets.

@nextab
Created April 1, 2025 14:08
Show Gist options
  • Save nextab/71620af1544e54171aeb0ea6a8528d4f to your computer and use it in GitHub Desktop.
Save nextab/71620af1544e54171aeb0ea6a8528d4f to your computer and use it in GitHub Desktop.
<?php
// Get all ACF fields of the current post
$custom_fields = get_fields();
$available_fields = array();
if ($custom_fields) {
foreach ($custom_fields as $field_name => $field_value) {
$available_fields[$field_name] = $field_value;
}
}
// Output available fields
echo '<h2>Available Fields:</h2>';
echo '<pre>';
print_r($available_fields);
echo '</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment