inc/post-meta-box/post-meta-box.php
// Callback function to show fields in meta box
Callback function to show fields in meta box
Callback function to show fields in meta box
public function show($post) {
		echo '<input type="hidden" name="' . $this->id . '_meta_box_nonce" value="', wp_create_nonce('postmetabox' . $this->id) , '" />';
		echo '<table class="form-table">';
		foreach ($this->meta_box['fields'] as $field) {
			extract($field);
			$id = self::$prefix . $id;
			$value = self::get($field['id']);
			if (empty($value) && !sizeof(self::get($field['id'], false))) {
				$value = isset($field['default']) ? $default : '';
			}
			if( $this->meta_box['context'] == 'side' ){
				$widthtbl = '35%';
			} else {
				$widthtbl = '20%';
			}
			echo '<tr>', '<th style="width:'.$widthtbl.'"><label for="', $id, '">', $name, '</label></th>', '<td>';
			include "meta-fields/$type.php";
			if (isset($desc)) {
				echo '&nbsp;<span class="description">' . $desc . '</span>';
			}
			echo '</td></tr>';
		}
		echo '</table>';
	}
public function show ( $ post ) { echo '<input type="hidden" name="' . $ this -> id . '_meta_box_nonce" value="' , wp_create_nonce ( 'postmetabox' . $ this -> id ) , '" />' ; echo '<table class="form-table">' ; foreach ( $ this -> meta_box [ 'fields' ] as $ field ) { extract ( $ field ) ; $ id = self :: $ prefix . $ id ; $ value = self :: get ( $ field [ 'id' ] ) ; if ( empty ( $ value ) && ! sizeof ( self :: get ( $ field [ 'id' ] , false ) ) ) { $ value = isset ( $ field [ 'default' ] ) ? $ default : '' ; } if ( $ this -> meta_box [ 'context' ] == 'side' ) { $ widthtbl = '35%' ; } else { $ widthtbl = '20%' ; } echo '<tr>' , '<th style="width:' . $ widthtbl . '"><label for="' , $ id , '">' , $ name , '</label></th>' , '<td>' ; include " meta-fields/ $ type .php " ; if ( isset ( $ desc ) ) { echo '&nbsp;<span class="description">' . $ desc . '</span>' ; } echo '</td></tr>' ; } echo '</table>' ; }
Callback function to show fields in meta box
Callback function to show fields in meta box