0

how can I make this metabox area

enter image description here

function bolumler_metabox()
{
    $screens = ['post', 'page'];
    foreach ($screens as $screen) {
        add_meta_box(
            'episodes',   // Benzersiz ID
            'Bölümler',       // Meta Box adı
            'bolumler_callback',       // Meta Box içeriğini bize gösterecek callback fonksiyonumuzun adı
            $screen                   // Yazı türü
        );
    }
}
add_action('add_meta_boxes', 'bolumler_metabox');

function bolumler_callback()
{

    global $post;
    $post_id = $post->ID;
    $meta_value = get_post_meta($post_id, 'episodes', true);
?>
    Bölüm Sayısı Örnek 1.Bölüm:
    
        " id="episodes" />
    
ID;

    if (isset($_POST['episodes']) && !empty($_POST['episodes'])) {
        update_post_meta($post_id, 'episodes', $_POST['episodes']);
    } else {
        delete_post_meta($post_id, 'episodes');
    }
}
add_action('save_post', 'bolumler_save');
3
  • 2
    Welcome, please take the time to explain what your code does, what it does not do, what is your aim etc - without detailed information people will not be able to answer your question correctly. – Q Studio Jan 10 at 9:00
  • I mean, how can I make a metabox like in the picture? Can you help me? I'm trying to set up for my anime viewing site. – Anime TR Jan 10 at 16:35
  • Please update your question, not here in comments - so that it is easy for everyone else to read and understand :) – Q Studio Jan 10 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.