/** * Add the html for the metabox: */ function cuisine_widget_home_text_meta_html() { $pid = cuisine_get_post_id(); $home_text = get_post_meta($pid, 'home_text_widget', true); //add the nonce: cuisine_get_nonce(); ?> <label class="cuisine_label clearfix">Titel: <input type="text" value="<?php echo $home_text['home_text_title']; ?> " name="home_text_title" class="cuisine_input" /></label> <label class="cuisine_label clearfix">Body:</label> <textarea id="home_text_body" name="home_text_body" style="width:100%;height:150px;"><?php echo $home_text['home_text_body']; ?> </textarea> <?php }
/** * Add the html for the metabox: */ function cuisine_widget_home_image_meta_html() { $pid = cuisine_get_post_id(); $home_images = get_post_meta($pid, 'home_widget_images', true); $i = 0; //add the nonce: cuisine_get_nonce(); foreach ($home_images as $img) { $wid = $img['image_widget_id']; $arrpos = 'home_image_widget_array[' . $i . ']'; ?> <div class="cuisine_home_image_widget"> <label class="cuisine_label"><p>Titel</p><input type="text" value="<?php echo $img['title']; ?> " name="<?php echo $arrpos; ?> [title]"/></label> <p class="cuisine_widget_centralized"> <div id="imagecontainer-<?php echo $wid; ?> " class="cuisine_widget_centralized"> <?php if ($img['url'] != '#') { ?> <img src="<?php echo $img['url']; ?> " id="image-<?php echo $wid; ?> " class="cuisine_widget_image"/> <?php } ?> </div> </p> <p class="cuisine_widget_centralized"> <a href="#" class="button-primary cuisine-widget-media" data-widget="<?php echo $wid; ?> " style="text-decoration:none"><?php echo __('Afbeelding kiezen'); ?> </a> </p> <label class="cuisine_label"><p>Link</p><input type="text" value="<?php echo $img['link']; ?> " name="<?php echo $arrpos; ?> [link]"/></label> <input type="hidden" name="<?php echo $arrpos; ?> [link_target]" value="<?php echo $img['link_target']; ?> "/> <input type="hidden" id="imageurl-<?php echo $wid; ?> " name="<?php echo $arrpos; ?> [url]" value="<?php echo $img['url']; ?> " /> <input type="hidden" id="imageid-<?php echo $wid; ?> " name="<?php echo $arrpos; ?> [image_id]" value="<?php echo $img['image_id']; ?> " /> <input type="hidden" name="<?php echo $arrpos; ?> [image_widget_id]" value="<?php echo $wid; ?> " /> </div> <?php $i++; } echo '<div class="clearfix"></div>'; }