Forked from agragregra/wordpress-get-all-fields.php
Created
February 4, 2018 11:15
-
-
Save yuriitaran/9d901132fe46b97b237c39bc31b2e201 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