Skip to content

Instantly share code, notes, and snippets.

@anointed
Created July 19, 2012 04:10
Show Gist options
  • Save anointed/3140691 to your computer and use it in GitHub Desktop.
Save anointed/3140691 to your computer and use it in GitHub Desktop.
metabox code wrapper
<?php
function add_my_class( $begin, $field, $meta ) {
$begin = <<<HTML
<div class="field-wrap-{$field['id']}">
HTML;
$end = '</div>';
$class = 'rwmb-label';
if ( ! empty( $field['class'] ) )
$class = self::add_cssclass( $field['class'], $class );
if ( empty( $field['name'] ) )
return '<div class="rwmb-input">';
$html = <<<HTML
<div class="{$class}">
<label for="{$field['id']}">{$field['name']}</label>
</div>
<div class="rwmb-input">
HTML;
return $begin .$html .$end;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment