__( 'Disable DK PDF Button:' , 'dkpdf' ), 'description' => '', 'type' => 'checkbox', 'default' => '', 'section' => '' ); return $fields; } /** * Add metabox to post types */ function dkpdf_meta_box_setup () { // get post types selected in settings $pdfbutton_post_types = sanitize_option( 'dkpdf_pdfbutton_post_types', get_option( 'dkpdf_pdfbutton_post_types' ) ); if( $pdfbutton_post_types ) { // add metabox to selected post types foreach ( $pdfbutton_post_types as $post_type ) { add_meta_box( 'post-data', __( 'DK PDF', 'dkpdf' ), 'dkpdf_meta_box_content', $post_type, 'normal', 'high' ); } } } add_action( 'add_meta_boxes', 'dkpdf_meta_box_setup' ); /** * Add content to metabox */ function dkpdf_meta_box_content () { global $post_id; $fields = get_post_custom( $post_id ); $field_data = dkpdf_get_custom_fields_settings(); $html = ''; $html .= ''; if ( 0 < count( $field_data ) ) { $html .= '
' . $v['name'] . ' | ' . "\n"; $html .= ' |
---|---|
' . "\n";
$html .= ' ' . $v['description'] . ' ' . "\n"; $html .= ' |