Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[WordPress] An example of cleanly organizing the front end of a custom meta box tabbed interface.
<div id="acme-navigation">
<h2 class="nav-tab-wrapper current">
<a class="nav-tab nav-tab-active" href="javascript:;">Extended Description</a>
<a class="nav-tab" href="javascript:;">Related Files</a>
<a class="nav-tab" href="javascript:;">Similar Posts</a>
<?php include_once( 'partials/extended-description.php' ); ?>
<?php include_once( 'partials/related-files.php' ); ?>
<?php include_once( 'partials/similar-posts.php' ); ?>
<div id="custom-meta-box-nonce" class="hidden">
<?php echo wp_create_nonce( 'acme-custom-meta-box-nonce' ); ?>
<div id="acme-extended-description" class="meta-options">
<label for="acme-extended-description-field">
Extended Description
<textarea name="acme-extended-description-field" id="acme-extended-description-field">
<?php get_post_meta( $post->ID, 'acme_extended_description_field', true ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment