Skip to content

Instantly share code, notes, and snippets.

@mmizwicki
mmizwicki / add-role-and-access-to-gravity-forms.php
Created April 23, 2020 03:32
Add new non-admin user role to access to Gravity Forms
//https://legacy.forums.gravityhelp.com/topic/forms-not-visible-to-editors
// add client role that has access to Gravity Forms (except for settings)
// this role is an addition of the Editor role
if (!get_role('client'))
{
$caps = get_role('editor')->capabilities;
$caps = array_merge($caps, array(
'gravityforms_create_form' => true,
## Run this in phpMyadmin
##
## Cleans up Posts table
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“');
UPDATE wp_posts SET post_content = REPLACE(post_content, '”', '”');
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’');
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘');
UPDATE wp_posts SET post_content = REPLACE(post_content, '—', '–');
UPDATE wp_posts SET post_content = REPLACE(post_content, '–', '—');
UPDATE wp_posts SET post_content = REPLACE(post_content, '•', '-');