Exemplo n.º 1
0
 /**
  * Creates a new group
  *
  * @global wpdb $wpdb
  * @param string $name A short, meaningful name for the group
  * @param string $description A more detailed description for the group
  * @return <type>
  */
 public static function create_group($name, $description)
 {
     global $wpdb;
     if (!CTXPS_Queries::check_group_exists($name)) {
         $current_user = wp_get_current_user();
         if (CTXPS_Queries::add_group($name, $description, $current_user->ID) !== FALSE) {
             return '<div id="message" class="updated"><p>' . __('New group created', 'contexture-page-security') . '</p></div>';
         } else {
             return '<div id="message" class="error below-h2"><p>' . __('Unable to create group. There was an unspecified system error.', 'contexture-page-security') . '</p></div>';
         }
     } else {
         return '<div id="message" class="error below-h2"><p>' . __('Unable to create group. A group with that name already exists.', 'contexture-page-security') . '</p></div>';
     }
 }