Pulling all custom Post meta without a filter? (2 posts)

  1. Chris Klosowski
    Posted 3 years ago #

    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.

  2. Alexander
    Posted 3 years ago #

    Hi Chris Klosowski,

    Maybe it's not so risky as you might think, as the theme only displays the meta information that it is using by default.

    If there is any highly classified information stored in any custom fields of a public blog page, you might reconsider if a public blog space is the right place to store this kind of information.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic