• Resolved karinamendonca29

    (@karinamendonca29)


    Hey Peter,

    I was wondering if maybe you could add a check to the credit field if it is left empty?
    Like maybe a reminder in the event that an editor may have missed filling it out?

    Do let me know if this would be possible for you to incorporate.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author pepe

    (@pputzer)

    Do you mean in the post editor (when inserting an image) or in the media library?

    Thread Starter karinamendonca29

    (@karinamendonca29)

    Yes, in the post editor while inserting an image inside a blog post.

    Thread Starter karinamendonca29

    (@karinamendonca29)

    Can you please let me know if this can be done? Just like a reminder that the image is missing credits to make the editor aware.

    Or let me know if there is something that I can handle at my end like a hook maybe?

    Plugin Author pepe

    (@pputzer)

    I’m not sure if there is a way to easily notify the user from within the media/shortcode code. Also, as currently written, it is possible to intentionally leave the credit field blank. It would probably be easier to add a filter hook to the media library screens to allow for enforcing entering a freetext credit. Would that help?

    Thread Starter karinamendonca29

    (@karinamendonca29)

    What would you suggest to be the best way? Basically anything that would help draw attention if the field is empty, just to be sure that it was done intentionally (No credits required).
    Refer : https://prnt.sc/jik8i9

    Let me know if you have any work arounds.

    Plugin Author pepe

    (@pputzer)

    That’s the Media API, and it’s kinda scary, TBH. You could probably hook into the click event for the Insert button with a bit of jQuery, though, and then just check if the Credit field is empty. I don’t think there is anything happening on the PHP side, so I can’t provide a regular filter or action hook.

    Thread Starter karinamendonca29

    (@karinamendonca29)

    Sure, will try with jQuery.I’m finding it difficult to hook into the click event for the insert button, but that seems to be the only way to go about it!

    Thanks for getting back, truly appreciate it ??

    Plugin Author pepe

    (@pputzer)

    Have a look at https://github.com/mundschenk-at/media-credit/blob/master/admin/js/media-credit-attachment-details.js to see how I hook into the prototypes of the media modals. Unfortunately, there is not a lot of documentation for the Media API.

    Plugin Author pepe

    (@pputzer)

    @karinamendonca29, have you been able to resolve this issue?

    Thread Starter karinamendonca29

    (@karinamendonca29)

    Hey Peter,

    Unfortunately no, the solution seemed a bit too complicated and my schedule didn’t allow for me to work on it. So its on the back burner for now.

    Thanks for all the help and suggestions!

    Plugin Author pepe

    (@pputzer)

    OK, then I’ll close the topic for now. If you do take up the project again and need help, you can open it up again or start a new thread if the questions go into another direction.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Add check if credit field is left empty’ is closed to new replies.