Skip to content

Instantly share code, notes, and snippets.

@version-control
Created December 19, 2017 07:28
Show Gist options
  • Save version-control/24f39a24b1e22563878da006964da07a to your computer and use it in GitHub Desktop.
Save version-control/24f39a24b1e22563878da006964da07a to your computer and use it in GitHub Desktop.
ACL Plugin does not have retrospective renaming of fields within the system. Pretty pointless in my eyes but if you do install ACL and then decide to rename the fields then use the database.
Below is from the owner on the forum.
------------------------------------------
The best way is to edit the field and change the field name. Next, access your DB via phpMyAdmin and write some SQL to look for the old field_name and replace it with the new field_name.
The field name will bi found multiple times in the wp_postmeta table in the meta_name column.
For each row in the wp_postmeta table, there is a second row containing a ‘reference’ from the value to the field object. This looks like an underscored version.
So, to change both the field_name and the reference rows, you would write something like this:
UPDATE wp_postmeta
SET meta_key = 'new_field_name'
WHERE meta_key = 'old_field_name';
and
UPDATE wp_postmeta
SET meta_key = '_new_field_name'
WHERE meta_key = '_old_field_name';
Hope that helps
Thanks
E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment