pods_access

(Since 1.2.0) -- check whether the currently logged-in user can access certain Pods features
function pods_access($priv)

Parameters

ParameterTypeDetails
$priv STRING a privilege name (see below)

Available Privileges

  • manage_pods
  • manage_templates
  • manage_pod_pages
  • manage_helpers
  • manage_roles
  • manage_settings
  • manage_content
  • manage_packages
  • manage_menu
  • pod_{POD_NAME}

Returns

True or false.

Examples

<?php
if (pods_access('manage_helpers')) {
    // The user can access helpers
}
?>
<?php
if (pods_access('pod_event')) {
    // The user can access the "event" pod
}
?>
See Also