public function saveProfileFields($user_id)
    {
        // Get contents
        $fields = $this->fields;

        // Check fields
        if (empty($fields)) {
            return;
        }

        // Check if current user can edit profile
        if (!current_user_can('edit_user', $user_id)) {
            return false;
        }

        // Get all values
        foreach ($fields as $field) {
            if (!$field) {
                continue;
            }

            // Build contents
            $ctn = (array) $field->getModel()->getContents();
            $hasId = (boolean) $field->getModel()->getHasId();

            // Check ID
            if ($hasId && (!isset($ctn['id']) || empty($ctn['id']))) {
                continue;
            }

            $value = Request::post($ctn['id']);
            Option::updateAuthorMeta($user_id, $ctn['id'], $value);
        }
    }
public function saveProfileFields($user_id)
    {
        // Get contents
        $fields = $this->fields;

        // Check fields
        if (empty($fields)) {
            return;
        }

        // Check if current user can edit profile
        if (!current_user_can('edit_user', $user_id)) {
            return false;
        }

        // Get all values
        foreach ($fields as $field) {
            if (!$field) {
                continue;
            }

            // Build contents
            $ctn = (array) $field->getModel()->getContents();
            $hasId = (boolean) $field->getModel()->getHasId();

            // Check ID
            if ($hasId && (!isset($ctn['id']) || empty($ctn['id']))) {
                continue;
            }

            $value = Request::post($ctn['id']);
            Option::updateAuthorMeta($user_id, $ctn['id'], $value);
        }
    }
public function saveProfileFields ( $ user_id ) { // Get contents $ fields = $ this -> fields ; // Check fields if ( empty ( $ fields ) ) { return ; } // Check if current user can edit profile if ( ! current_user_can ( 'edit_user' , $ user_id ) ) { return false ; } // Get all values foreach ( $ fields as $ field ) { if ( ! $ field ) { continue ; } // Build contents $ ctn = ( array ) $ field -> getModel ( ) -> getContents ( ) ; $ hasId = ( boolean ) $ field -> getModel ( ) -> getHasId ( ) ; // Check ID if ( $ hasId && ( ! isset ( $ ctn [ 'id' ] ) || empty ( $ ctn [ 'id' ] ) ) ) { continue ; } $ value = Request :: post ( $ ctn [ 'id' ] ) ; Option :: updateAuthorMeta ( $ user_id , $ ctn [ 'id' ] , $ value ) ; } }
Hook to save user custom fields.

@param integer $user_id
Hook to save user custom fields .