• Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
  • Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
home/Knowledge Base/Code snippets/Changing default owner type

Changing default owner type

186 views 0 April 13, 2021 vprat

When creating private content, the default owner type is set to ‘User’. If you want to change this and by default show another type, you can insert this code snippet in your theme’s functions.php file.

add_filter('cuar/core/ownership/default-owner-type', 'cuar_default_owner_type');
function cuar_default_owner_type($t) {
    return 'grp';
}

As of today, the owner types which are available are:

  • usr: User (the default)
  • grp: Group (available in the additional owner types add-on)
  • rol: WordPress role (available in the additional owner types add-on)
  • mgrp: Managed group (available in the managed groups add-on)
  • sgrp: Managed group (available in the smart groups add-on)
  • prj: Project (available in the projects add-on)
Tags:ownership

Was this helpful?

Yes  No
Related Articles
  • Disable CSS resets and allow integration of third party plugins
  • Automatically add a user to a group
  • Changing the default page shown by the Customer Area
  • Changing the page shown after logout
  • Sidebars: how to disable them
  • Detect if you are on a page in the customer area
Knowledge base
  • Code snippets
  • Use cases
  • Community links
Documentations
  • Getting started
  • Using code snippets
  • The template system
  • Full documentation
FAQ
  • About licences
  • Pre-sales questions
  • After-sales questions
  • Plugin usage
  • Technical questions
  • Payments
Support
  • Pre-sales Enquiries
  • Main plugin support
  • Premium add-ons support
  • Feature Requests
  • Terms and conditions for sales
  • Refund policy
  • Privacy Policy
  • Legal notices
  • Copyright 2021 wp-customerarea.com. All Rights Reserved.