WordPress.org

Ready to get started?Download WordPress

Forums

Attachments
[resolved] Limiting attachments number (3 posts)

  1. lucspe
    Member
    Posted 9 months ago #

    Hi,

    Great plugin.

    I was wondering if there is a way to limit the max number of attachments a metabox should allow to only 1.

    Thanks

    http://wordpress.org/plugins/attachments/

  2. Jonathan Christopher
    Member
    Plugin Author

    Posted 9 months ago #

    Hi yes you can set a limit when setting up your Instance, I'll be sure to update the documentation. It'll look something like this:

    'limit' => 1

    in your $args array when setting up the instance.

  3. lucspe
    Member
    Posted 9 months ago #

    Thanks, works like a charm!

    Only issue (minor) I am facing in that then when you have already an attachment it does not disable the "add" button but if you click on it, it will display a "currently limited to 1" message, which I can't find it in the .pot file to localize it.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.