Pulling all custom Post meta without a filter?
-
I just started using this theme and was running into an issue with all of my custom post meta showing up on single posts.
I found this bit of code in the functions.php:
<?php $meta_keys = get_post_meta( get_the_ID() ); ?> <?php foreach( $meta_keys as $meta => $value ) : ?> <?php if( ( '_' != $meta[0] ) && ( 'enclosure' != $meta ) ) : ?> <span class="custom-meta"><strong><?php echo $meta; ?>:</strong> <?php echo $value[0]; ?></span> <?php endif; ?> <?php endforeach; ?>
This seems quite risky considering some plugins store post meta for non-user-facing information.
This should either pull only meta information this theme is generating, or at the least offer up a filter so that we site owners and plugin developers can filter the list of meta keys to show or hide.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pulling all custom Post meta without a filter?’ is closed to new replies.