function widget($args, $instance) { extract($args, EXTR_SKIP); echo $before_widget; global $jh_portfolio; ?> <!-- Additional Info --> <?php if (jhp_has_info(null, 'url,related_work')) { ?> <h4>Additional Information</h4> <?php if ($url = jhp_get_url()) { ?> <p><strong>Visit</strong><br /><a target="_blank" href="<?php echo $url; ?> "><?php echo $url; ?> </a></p> <?php } ?> <?php if ($related_work = jhp_get_related_work()) { ?> <p><strong>Related Work</strong></p> <ul id="related-work"> <?php foreach ($related_work as $post_id) { ?> <li><a href="<?php echo get_permalink($post_id); ?> "><?php echo get_the_title($post_id); ?> </a></li> <?php } ?> </ul> <?php } ?> <?php } ?> <?php echo $after_widget; }
function jhp_additional_information_meta_box($post) { ?> <p><label>URL</label></p> <input id="website_url" type="text" name="url" value="<?php echo jhp_get_url($post); ?> " /> <p><label>Related Work (post ID)</label></p> <input type="text" name="related_work" value="<?php echo implode(', ', (array) get_post_meta($post->ID, 'related_work', true)); ?> " /> <?php }