• Resolved block

    (@brandanhadlock)


    Hello. I’d like to set the default setting for who can view a doc to only logged-in users. How can I do that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Cavins

    (@dcavins)

    Hi @brandanhadlock-

    You can change the default options using the bp_docs_get_default_access_options filter. It happens here:
    https://github.com/boonebgorges/buddypress-docs/blob/1.9.x/includes/functions.php#L585

    Best,

    -David

    Thread Starter block

    (@brandanhadlock)

    Dave, thanks for the link to the filter. Does the function end on line 603? Could you tell me what change I need to make to set the default for viewing a doc to logged-in users only? When I update the plugin, will I need to update the code as well in order to maintain that setting?

    Plugin Author David Cavins

    (@dcavins)

    Hi there. Filters are one of the core ideas in WordPress. They allow you to change behaviors without modifying a plugin’s code. You’ll need to understand actions and filters if you want to customize behaviors in WP. Read more: https://dev.themeblvd.com/tutorial/filters/

    Here’s the filter you need in this case:
    https://gist.github.com/dcavins/0f9943c2e2dd506afc58c3b56f8013c8

    If you don’t already have a bp-custom.php file in the wp-content/plugins folder on your server, then add the entire code I’ve provided as a new file. Otherwise, just add the add_filter and function() to the file. https://codex.buddypress.org/themes/bp-custom-php/

    Best,

    -David

    Thread Starter block

    (@brandanhadlock)

    David,

    Thank you for the links and for the code. I was able to make it work!

    Hello there,

    I have been trying for a few days now but cannot seem to have it setup the right way for my install.
    I use ARMember for access related stuff. I have several ‘plans’ which have different types of access. I want to give the users with plan ‘VIP’ the ONLY user that has Read access to your nice plugin. Besides admin ofcourse. The users from ArMember are also available as WP Role. Please help me out here.

    regards,
    patrick

    • This reply was modified 7 years, 4 months ago by patricktank.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I set the default permissions for a doc?’ is closed to new replies.