WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
How to filter downloads by 'req-role' custom field (3 posts)

  1. exhtml
    Member
    Posted 1 year ago #

    Hi everyone! Anyone knows how to retrieve the value of a custom field assigned to a download in WordPress Download Monitor? Concretely I wanted to use the built 'req-role' custom field (used to show files only to one determined user role), to filter the download list and show files that each custom role can download. I have read all the documentations and search all the forums but don't find any answer about that.
    Thanks in advance!

    http://wordpress.org/extend/plugins/download-monitor/

  2. skynetsolutionsinfo
    Member
    Posted 1 year ago #

    use 2 more plugins
    User Role Editor & User specific Content

    first create a users using User Role Editor
    e.g user-1 & user-2

    in Edit Download Information of Download ID 1
    use Custom fields
    Name=> req-role
    Value=> user-1

    in Edit Download Information of Download ID 2
    use Custom fields
    Name=> req-role
    Value=> user-2

    using with User specific Content Plugin

    [O_U user_role="user-1"]
    <h2>User 1 content goes here</h2>
    [download id=1]
    [/O_U]

    [O_U user_role="user-2"]
    <h2>User 2 content goes here</h2>
    [download id=2]
    [/O_U]

  3. exhtml
    Member
    Posted 1 year ago #

    Thanks for your answer, I'm using User Role Editor yet to crearte the user roles. Indeed, I was looking for a 'more automated' way of filtering the downloads list. Finally found a way to access the value of the req-role custom field:
    $d->meta['req-role']
    So you can filter the download list for a concrete user-role.
    Hope it helps for anyone,

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.