Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/510fb0643e6c47136e35 to your computer and use it in GitHub Desktop.
Save hissy/510fb0643e6c47136e35 to your computer and use it in GitHub Desktop.
#concrete5 #concrete56 Manually add a UserAttributeKey
<?php
// Attribute Type Handle
$akTypeHandle = 'text';
// Get your package
$pkg = Package::getByHandle('your_package_handle');
// Attributes
$args = array(
'akHandle' => 'example_attribute',
'akName' => 'Example Attribute',
'akIsSearchableIndexed' => 0,
'akIsSearchable' => 1,
'uakProfileDisplay' => 1,
'uakProfileEdit' => 1,
'uakProfileEditRequired' => 1,
'uakRegisterEdit' => 1,
'uakRegisterEditRequired' => 0,
'uakMemberListDisplay' => 0
);
// Add
UserAttributeKey::add($akTypeHandle, $args, $pkg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment