latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Blank line after adding note via remote api

Home Forums Community Forum Blank line after adding note via remote api

This topic contains 3 replies, has 2 voices. Last updated by  Cristián Lávaque 3 years, 9 months ago.

Topic Author Topic
Posted: Monday Apr 1st, 2013 at 4:23 am #46264
BoMember
Username: BoMember

Hi!

If I use the remote api to add a note to an existing user, like this:

(...)
"s2member_notes" => "Transaction complete $trans_id: $today",
(...)

it will add the note succesfully, but with a blank line. Example:

Demoted by s2Member: Tue Feb 12, 2013 3:08 pm UTC
Demoted by s2Member: Tue Feb 12, 2013 4:08 pm UTC
Demoted by s2Member: Tue Feb 19, 2013 10:38 pm UTC

Transaction complete 123456: Tue Feb 13, 2013 3:08 pm UTC

Transaction complete 123456: Tue Feb 13, 2013 3:10 pm UTC

Transaction complete 123456: Tue Feb 13, 2013 3:12 pm UTC

Do you know how to solve this?
Thanks!

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Apr 2nd, 2013 at 5:30 am #46356

Ah, that’s probably because there are a couple of newlines ([hilite mono]\n[/hilite]) here: s2member-pro\includes\classes\remote-ops-in.inc.php

[hilite pre_code]
update_user_option($user->ID, "s2member_notes", trim(get_user_option("s2member_notes", $user->ID)."\n\n".(string)$op["data"]["s2member_notes"]));
[/hilite]
Posted: Tuesday Apr 2nd, 2013 at 7:28 am #46367
BoMember
Username: BoMember

Thanks! Works like a charm!

Posted: Thursday Apr 4th, 2013 at 5:49 am #46575

Great. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.