Devam Ediyor

501788 adding second and third metabox (Wordpress)

I have this code:

<code>

$prefix = 'dbt_';

$meta_box = array(

'id' => 'help-section-video',

'title' => 'Help Section',

'page' => 'video',

'context' => 'side',

'priority' => 'high',

'fields' => array(

array(

'name' => '',

'class' => 'calendar',

'id' => $prefix . 'text',

'type' => 'calendar',

'std' => ''

),

array(

'name' => '',

'class' => 'contributor_tutorial_video',

'id' => $prefix . 'text',

'type' => 'contributor',

'std' => ''

),

array(

'name' => '',

'class' => 'editor_tutorial_video',

'id' => $prefix . 'text',

'type' => 'editor',

'std' => ''

),

array(

'name' => '',

'class' => 'producer_tutorial_video',

'id' => $prefix . 'text',

'type' => 'producer',

'std' => ''

),

)

);

add_action('admin_menu', 'mytheme_add_box');

// Add meta box

function mytheme_add_bo1() {

global $meta_box;

add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);

}

// Callback function to show fields in meta box

function mytheme_show_box() {

global $meta_box, $post;

// Use nonce for verification

echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';

echo '<table class="form-table">';

foreach ($meta_box['fields'] as $field) {

// get current post meta data

$meta = get_post_meta($post->ID, $field['id'], true);

echo '<tr class="', $field['class'], '">',

'<td>';

switch ($field['type']) {

case 'calendar': ?>

<a href="" onClick="MyWindow=[url removed, login to view]('/calendar','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=950,heigh t=380'); return false;"><input type="button" style="width:244px" value="Show Calendar" /></a>

<?php echo '', '';

break;

//link #!

case 'contributor':

echo '<a title="How to create an Article with Video" class="thickbox" id="add_image" href="[url removed, login to view]"><input type="button" style="width:244px" value="Contributor Video Tutorial" /></a>';

break;

//link #2

case 'editor':

echo '<a title="How to create an Article with Video" class="thickbox" id="add_image" href="[url removed, login to view]"><input style="width:244px" type="button" value="Contributor Video Tutorial" /></a>';

break;

//link #3

case 'producer':

echo '<a title="How to create an Article with Video" class="thickbox" id="add_image" href="[url removed, login to view]"><input style="width:244px" type="button" value="Contributor Video Tutorial" /></a>';

break;

}

echo '<td>',

'</tr>';

}

echo '</table>';

}

</code>

i'd like to add this same metabox into post and audio (custom post type)

I'd also like to be able to change the links #1, #2, #3 for each post type.

Let me know if you need more info or this is enough and you know what to do. it should be easy task for somebody who knows wordpress and php.

Thanks

Jan

Beceriler: Her şey Kabul, PHP, WordPress

Daha fazlasını görün: use case tutorial, tutorial use case, std tutorial, prefix function, i need a producer name, how to create an article, how to be a producer, get a producer, c# context help, c array tutorial, button onclick php, i second you, wordpress audio, third, std, producer name, create a video for an article, add meta, input verification code, wordpress custom post type custom fields, post form hidden, php text array, wordpress add section, php table array, video switch

İşveren Hakkında:
( 30 değerlendirme ) Newport Beach, United States

Proje NO: #2247709