Last active
October 23, 2019 11:28
-
-
Save agragregra/5581bf686d960b4caf4d to your computer and use it in GitHub Desktop.
WordPress Get All Custom Fields without _edit_lock, _edit_last, _thumbnail_id
This file contains 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 | |
$custom_fields = get_post_custom($post->ID); | |
foreach ( $custom_fields as $field_key => $field_values ) { | |
if(!isset($field_values[0])) continue; | |
if(in_array($field_key,array("_edit_lock", "_edit_last", "_thumbnail_id"))) continue; | |
echo "<strong>$field_key:</strong> $field_values[0] <br>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment