Created
April 1, 2025 14:08
-
-
Save nextab/71620af1544e54171aeb0ea6a8528d4f 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 | |
// 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