Forums

addin meta-box to the attachment edit-page (4 posts)

  1. paka
    Member
    Posted 5 months ago #

    Hello Forum,

    I try to add a meta box (a checkbox) to the media edit-page.
    My first idea was, to use the same function, I use for adding meta-boxes to other post-types.
    But I've got two problems.
    1. Where to hook the function, to call the add_meta_box() function.
    I tried admin-init, and this works so far, that I get the datas in the global $wp_meta_boxes variable.
    2. What do I pass as page-parameter of add_meta_box().
    As I understand, the string given to the function has to match the slug, I get in the url after post.php, but attachments are edited via media.php. So add_meta_box() will never be called.

    Now I wonder, if there is any way, to display a check-box at the media-page.

    To save the input, I will try to use the same functions, I use for 'normal' meta-values I get if I use custom-fields at the attachment page.

    Greets Paka

  2. thereformation
    Member
    Posted 5 months ago #

    look at attachment_fields_to_edit and attachment_fields_to_save.

    There is a tut here: http://net.tutsplus.com/tutorials/wordpress/creating-custom-fields-for-attachments-in-wordpress/

  3. paka
    Member
    Posted 5 months ago #

    Hello and thanks thereformation,

    it looks, as if this is exactly what I'm looking for.
    I will try this later this evening.

    Greets

    Paka

  4. thereformation
    Member
    Posted 5 months ago #

    No probs.

Reply

You must log in to post.

About this Topic