Skip Navigation

[Resolved] No value for author-id with using [get_author_id_in_archive]

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by alperenK 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1815513
third-party-shortcode.png
message-to-empty.png

Tell us what you are trying to do?
I tried to set up messaging system as described but somehow I get no value back for [get_author_id_in_archive] (message to)
Is there any documentation that you are following?
I saw a similar ticket: https://toolset.com/forums/topic/why-cant-i-see-the-data/ and tried to edit functions.php with adapted snippet: $author = get_queried_object(); with: $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); unfortunately with no success
Is there a similar example that we can see?
added pic
What is the link to your site?
hidden link (maintenance on)

#1816279

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I will require to check where exactly you have added the shortcode as well as the problem URL so I can investigate this issue further.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1816361

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The author of the post should be assigned the ID of current post author ID where you display the "New Message" form.

So, I've changed the "wpcf-message-to" field default value using the shortcode: [wpv-post-author format='meta' meta='ID']
=> hidden link

[cred_generic_field field='wpcf-message-to' type='hidden' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist":1,
"generic_type":"user_id",
"default":"[wpv-post-author format='meta' meta='ID']"
}
[/cred_generic_field]

You can see its already mentioned with the following doc under the "New Message" section:
=> https://toolset.com/documentation/legacy-features/miscellaneous/how-to-create-a-messaging-system-with-toolset/#new-message-form

[get_author_id_in_archive] shortcode is used for user profile (user archive pae) so you will not require this shortcode.

Can you please test now and check if you able to record the message-to ID now and everything else works as expected.

Please perform a test from scratch.
- Please make sure you add a new message and try to reply that message.

#1816389
message-to.png
inbox-same-message.png

the field has now the value of post-author, but the post-author is getting the sent out message also in the inbox see attached pics.

In the inbox-view is the query set up with the "message-to" value.. did I miss something out?

#1817123

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is strange there must be some thing you missed from the tutorial.

Can you please setup two frontend user as well as make sure you have created few posts whose author is the sender or receiver.
- Sender
- Receiver

Can you please send me frontend access details for one sender and receiver and I would be happy to test this further.

I have set the next reply to private which means only you and I have access to it.

#1817923

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

within the following view:
=> hidden link

I've changed the following line of code from:

[wpv-user field='user_firstname' id='[types field="message-from" output="raw"][/types]'] [wpv-user field='user_lastname' id="[types field='message-from' output='raw'][/types]"]         

To:

[wpv-user field='user_firstname' id='[types field="message-to" output="raw"][/types]'] [wpv-user field='user_lastname' id="[types field='message-to' output='raw'][/types]"]         

And on the following page:
=> hidden link

I've added the view as given under using shortcode block:

[wpv-view name="my-messages-received" info="[wpv-current-user info='id']" cached="off"]

Can you please confirm it works as expected?

#1818551

My issue is resolved now. Thank you! Very competent support!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.