Forked from agragregra/wordpress-get-all-fields.php
Created
November 11, 2017 14:26
-
-
Save zhukovec/0fdc6a7d8e7eae2b495e58213663131b to your computer and use it in GitHub Desktop.
WordPress Get All Custom Fields without _edit_lock, _edit_last, _thumbnail_id
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 | |
| $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