php 更改重力表单管理权限,使作者能够导出或编辑表单
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 更改重力表单管理权限,使作者能够导出或编辑表单相关的知识,希望对你有一定的参考价值。
<?php
// get role by name (change 'editor' to a role)
$role = get_role( 'editor' );
// or get user by user ID (change $id to an id)
// $role = new WP_User( $id );
// or get user by username (change $name to a username)
// $role = new WP_User( null, '$name' );
// add core gravity form capabilities
// adjust as required
$role->add_cap( 'gravityforms_edit_forms' );
$role->add_cap( 'gravityforms_delete_forms' );
$role->add_cap( 'gravityforms_create_form' );
$role->add_cap( 'gravityforms_view_entries' );
$role->add_cap( 'gravityforms_edit_entries' );
$role->add_cap( 'gravityforms_delete_entries' );
$role->add_cap( 'gravityforms_view_settings' );
$role->add_cap( 'gravityforms_edit_settings' );
$role->add_cap( 'gravityforms_export_entries' );
$role->add_cap( 'gravityforms_view_entry_notes' );
$role->add_cap( 'gravityforms_edit_entry_notes' );
// $role->add_cap( 'gravityforms_feed' );
// $role->add_cap( 'gravityforms_uninstall' );
// gravity form add-on capabilities
// Campaign Monitor
// $role->add_cap( 'gravityforms_campaignmonitor' );
// $role->add_cap( 'gravityforms_campaignmonitor_uninstall' );
// Freshbooks
// $role->add_cap( 'gravityforms_freshbooks' );
// $role->add_cap( 'gravityforms_freshbooks_uninstall' );
// MailChimp
// $role->add_cap( 'gravityforms_mailchimp' );
// $role->add_cap( 'gravityforms_mailchimp_uninstall' );
// PayPal
// $role->add_cap( 'gravityforms_paypal' );
// $role->add_cap( 'gravityforms_paypal_uninstall' );
// User Registration
// $role->add_cap( 'gravityforms_user_registration' );
// $role->add_cap( 'gravityforms_user_registration_uninstall' );
?>
以上是关于php 更改重力表单管理权限,使作者能够导出或编辑表单的主要内容,如果未能解决你的问题,请参考以下文章
php 重力形式复选框限制器
php 获取2018年10月未被管理员创建的未被删除的重力表单条目
php 将表单名称作为数据属性添加到重力表单表单元素
php 重力Wiz //重力形式//使用条目填充表单(可选择在提交时更新条目)
jquery 使字段不可编辑,没有只读或禁用
仅为具有特定 Memberpress 订阅的用户隐藏重力表单字段