Metas for Attachment Post Type

Support General Metas for Attachment Post Type

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #4996
    socialitysociality
    Participant

    Hello there!

    I have added some fields in attachment post type. I can see them in "Edit more details" option in the "Attachment Details". Still, I want to put those fields in "Attachment Details" pop up in order to be easier for the user to edit them and being autosaved that have to take one more step to do that. Is this possible via your plugin?

    Thank you and congrats for the nice plugin 🙂

    #5037
    Anh TranAnh Tran
    Keymaster

    I'm afraid not. The "Attactment Details" popup is created and triggered by JavaScript, while most of our work is PHP.

    #5065
    socialitysociality
    Participant

    Too sad.

    Well, I believe that it should be much more easier for the user to fulfill the metas through the pop up window and not through the page of the attachment (one step more). Does any other of your plugins do that or maybe you could somehow guide me and achieve this?

    Thank you anyway 🙂

    #5071
    Anh TranAnh Tran
    Keymaster

    I've seen Jetpack plugin do that. Not sure if there's any solution in general for that.

    #5074
    socialitysociality
    Participant

    I found this article https://code.tutsplus.com/articles/how-to-add-custom-fields-to-attachments--wp-31100

    describing what we are talking about. Take a look at show_in_modal parameter. It is exactly what I want. Maybe you could integrate that into your plugin.

    Cheers.

    #5091
    Anh TranAnh Tran
    Keymaster

    Great link! Thanks for letting me know. I will check that.

    #5093
    socialitysociality
    Participant

    😉 Well if you make any updates, let me know! Thank you for the support.

    Cheers.

    #5128
    Anh TranAnh Tran
    Keymaster

    Hi again,

    I was able to do this! You need to download the development version on Github to have this feature: https://github.com/rilwis/meta-box

    To enable a meta box for media modal, you need to set:

    'post_types' => 'attachment',
    'media_modal' => true,

    to the meta box parameters.

    Take a look at the demo here: https://github.com/rilwis/meta-box/blob/master/demo/media-modal.php

    #5130
    socialitysociality
    Participant

    Hello,

    Thank you. I installed the development version and I got some errors such as

    Fatal error: Uncaught Error: Call to a member function get_source_lang_code() on null in /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-content/plugins/meta-box-master/inc/wpml.php:97 Stack trace: #0 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-includes/class-wp-hook.php(298): RWMB_WPML->modify_field(Array) #1 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #2 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-content/plugins/meta-box-master/inc/meta-box.php(320): apply_filters('rwmb_normalize_...', Array) #3 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-content/plugins/meta-box-master/inc/meta-box.php(46): RW_Meta_Box::normalize_fields(Array) #4 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-content/plugins/meta-box-master/inc/core.php(62): RW_Meta_Box->__construct(Array) #5 /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-includes/class-wp-hook.php(298): RWMB_Core->register_meta_boxes('') #6 /home/so in /home/socia979/public_html/coloursofajourney.eu/cOlJ/wp-content/plugins/meta-box-master/inc/wpml.php on line 97

    Are you sure I can use this version for a production environment?

    #5135
    Anh TranAnh Tran
    Keymaster

    Sorry, I missed a check for WPML which causes the Fatal error. Please try again.

    #5138
    socialitysociality
    Participant

    Alright,

    It worked. You can close the thread 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Metas for Attachment Post Type’ is closed to new replies.