I decided it was time to update the theme for this site to something a little less…kid like? I dunno, it was growing old on me. I always typically just go through the basic featured themes on WordPress.org trying to find something that will suit my needs. I don’t want to make it a labor of love…just somewhere I can post my thoughts. Anyway, I’m digressing.

I ended up on this nice looking, feature rich, responsive (need this) theme called Pinboard. Yep, it’s a popular one, I’m fine with that. I was having this weird issue where on posts imported from Flickr, a double image was showing, as well as some extra information about the Flickr URL. I decided to dive in.

Turns out, this theme has a function that takes all post meta entries (custom fields) and displays them. Here’s the code:

<?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 was the cause of my problem. I was seeing entries made by the Flickr import, in my post meta area. I’ve submitted a support ticket asking for a clarification as to why they would do this or if they’d consider a filter on this. I’ll update the post when I hear back.

This is a bad idea for a few reasons, but most importantly, some plugins use this area to store non-user-facing information about the posts. Doing a blanket display of postmeta could result in some improperly formatted or private data being shown to users.

Post image by motti82 via Flickr & Creative commons

Posted by Chris Klosowski

Chris Klosowski is the Director of Technology at Sandhills Development, LLC, creators of fine WordPress plugins, and ecommerce solutions.

One Comment

  1. Wonderful work! That is the kind of information that are meant to be shared across the web.
    Disgrace on Google for now not positioning this submit upper!
    Come on over and seek advice from my web site .
    Thank you =)

    Reply

Leave a reply

Your email address will not be published. Required fields are marked *